FORCE ONE RECORD TO BE COMPLETED BEFORE ENTERING A NEW ONE

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top