FORCE ONE RECORD TO BE COMPLETED BEFORE ENTERING A NEW ONE

G

Guest

I have an Access Time Clock to SignIn and SignOut employees. Works fine!
Except that folks go home and forget to Sign Out. How can I stop an employee
from Signing In Again without first Signing Out a still open record? jjf
 
W

Wayne Morgan

When they begin to sign in, check for a sign in record with a Null value for
sign out. You could use the form's BeforeInsert event for this and Cancel if
you find an incomplete record.

Example:
Dim varRetValue
varRetValue = DLookup("RecordID", "TableName", "IsNull(SignOut)=True")
If Not IsNull(varRetValue) Then
Msgbox "You have a SignIn without a SignOut. Please correct this
entry.", vbOkOnly + vbExclamation
Cancel = True
Me.Recordset.FindFirst "RecordID=" & varRetValue
End If
 
G

Guest

thanks wayne

Wayne Morgan said:
When they begin to sign in, check for a sign in record with a Null value for
sign out. You could use the form's BeforeInsert event for this and Cancel if
you find an incomplete record.

Example:
Dim varRetValue
varRetValue = DLookup("RecordID", "TableName", "IsNull(SignOut)=True")
If Not IsNull(varRetValue) Then
Msgbox "You have a SignIn without a SignOut. Please correct this
entry.", vbOkOnly + vbExclamation
Cancel = True
Me.Recordset.FindFirst "RecordID=" & varRetValue
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top