We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,453 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how to change

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

4
Contributors
6
Replies
2 Weeks
Discussion Span
1 Year Ago
Last Updated
7
Views
kris222
Newbie Poster
14 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

change what?
Provide more information. explain more.

Jx_Man
Senior Poster
3,553 posts since Nov 2007
Reputation Points: 1,500
Solved Threads: 531
Skill Endorsements: 65

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

kris222
Newbie Poster
14 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: 8
Solved Threads: 3
Skill Endorsements: 0

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

androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: 8
Solved Threads: 3
Skill Endorsements: 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

androidz
Junior Poster
158 posts since Aug 2010
Reputation Points: 8
Solved Threads: 3
Skill Endorsements: 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

QVeen72
Veteran Poster
1,017 posts since Nov 2006
Reputation Points: 118
Solved Threads: 164
Skill Endorsements: 5

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.3045 seconds using 2.69MB