1,105,581 Community Members

how to change

Member Avatar
kris222
Newbie Poster
14 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

heres what i ve done

Private Sub cmdtimein_Click()
If txtempno.Text = "" Then
     MsgBox "Please Input employee number!", vbExclamation + vbOKOnly, "Employee Record"
          Exit Sub
   Adotime.Recordset.MoveNext
Else
Adotime.Recordset.AddNew
Adotime.Recordset.Fields("employeeno").Value = txtempno.Text
Adotime.Recordset.Fields("timein").Value = Time
Adotime.Recordset.Fields("timeout").Value = Time
Adotime.Recordset.Fields("date").Value = Date
Adotime.Recordset.Update
MsgBox "You are time in!", vbInformation + vbOKOnly, "Employee Attendance"
End If
End Sub

Private Sub cmdtimeout_Click()
Adotime.Recordset.EOF
If txtempno.Text = Adotime.Recordset.Fields("employeeno") Then
Adotime.Recordset.AddNew ---- i wanna change this to .Edit but it wont come out
Adotime.Recordset.Fields("employeeno").Value = txtempno.Text
Adotime.Recordset.Fields("timeout").Value = Time
Adotime.Recordset.Fields("date").Value = Date
Adotime.Recordset.Fields("noofhoursworked").Value = DateDiff("h", Adotime.Recordset.Fields("timein"), Adotime.Recordset.Fields("timeout"))
Adotime.Recordset.Update
MsgBox "You are time out!", vbInformation + vbOKOnly, "Employee Attendance"
lblhour.Caption = DateDiff("h", Adotime.Recordset.Fields("timein"), Adotime.Recordset.Fields("timeout"))
End If
End Sub

how do u change it

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
0
 

change what?
Provide more information. explain more.

Member Avatar
kris222
Newbie Poster
14 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i would to change the adotime.recordset.addnew to adotime.recordset.edit
but i cant cuz the dropdown box would come out

Member Avatar
androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

i think its not edit you mean its update. adotime.recordset.update

Member Avatar
androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

or adotime.edit you don't have to include the word recordset

Member Avatar
androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

Inline Code Example Here

Adotime.edit ---- changing to "edit"
Adotime.Recordset.Fields("employeeno").Value = txtempno.Text
Adotime.Recordset.Fields("timeout").Value = Time
Adotime.Recordset.Fields("date").Value = Date
Adotime.Recordset.Fields("noofhoursworked").Value = DateDiff("h", Adotime.Recordset.Fields("timein"), Adotime.Recordset.Fields("timeout"))
Adotime.Recordset.Update

Member Avatar
QVeen72
Veteran Poster
1,016 posts since Nov 2006
Reputation Points: 104 [?]
Q&As Helped to Solve: 164 [?]
Skill Endorsements: 7 [?]
 
0
 

Hi,

Like ADO recordset, you dont have to write ".Edit" explicitly...
just change and save...
something like this :

ADOTime("MyField") = Text1.text
ADOTime.Recordset.Update

Just make sure, Recordset is Dynamically opened....

Regards
Veena

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article