AFternoon Guys!
Well i'm at it again, or i should say my boss is at it again LOL. This
is what i'm trying to do, i'm not sure if it can be done, but here goes.
As you recall we set up an great If statemnet that says that if
StartDate is Null then populate StartDate & StartTime. If these fields
are populated them goto the StopDate & StopTime fields and populate
those.
Here's where it get's tricky. I have two things i need to try to do.
ONE is If both Start & Stop fields are populated it needs to go to a
new record, so that it won't overwrite the Employee Name in the Doneby
field. I knwo to use DoCmd.FindRecord , ,adNewRec. but not sure how
to write it. SECONDLY, When the employee scans his ID badge for the
second time, the system needs to find that open record where the
StartDate & StartTime have been populated by that particular ID.
I hope that this makes sense. Below is the code i'm working with so
far. Thanks a million guys. - Clayton
VBA CODE
Private Sub Doneby_AfterUpdate()
If IsNull(Forms![SCANFORM]!StartTime) Then
Forms![SCANFORM]!StartDate.SetFocus
Forms![SCANFORM]!StartDate.Value = CStr(Date)
Forms![SCANFORM]!StartTime.SetFocus
Forms![SCANFORM]!StartTime.Value = CStr(Time)
Else ' This line no longer has the : character
' Forms![SCANFORM]!StartTime = Not Null ''' this line commented out
Forms![SCANFORM]!StopDate.SetFocus
Forms![SCANFORM]!StopDate.Value = CStr(Date)
Forms![SCANFORM]!StopTime.SetFocus
Forms![SCANFORM]!StopTime.Value = CStr(Time)
End If
End Sub
Private Sub StopDate_BeforeUpdate(Cancel As Integer)
If (Forms![SCANFORM]!StopDate) = Not Null Then
LastFind = SCANFORM
Me.RecordsetClone.FindFirst "Doneby" = "Me!MyData"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Private Sub StopTime_Enter()
DoCmd.OpenForm "Splash_subform"
Me.TimerInterval = 1500
DoCmd.Close acForm, "frmSplash_subform"
End Sub
Private Sub StopTime_GotFocus()
DoCmd.GoToRecord , , acNewRec
Forms![SCANFORM]!ReworkNo.SetFocus
End Sub
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~->
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessDevelopers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/