Hello,
I am having a spot of trouble.
I have a check in and out system, when a person is checked in a new record is created on a table with the Now() data and the persons name, when they check out i want the Now() data to update on the last record made for that person.
the problem i am having is when i check out a person whom is already on the table a few times the Now() data replaces all the check out data, giving in correct times.
I have included screenshots and sample code, any help would be great.
In fact now since i have changed the code to the above the table is not updating at all with the new Now() data.
I am having a spot of trouble.
I have a check in and out system, when a person is checked in a new record is created on a table with the Now() data and the persons name, when they check out i want the Now() data to update on the last record made for that person.
the problem i am having is when i check out a person whom is already on the table a few times the Now() data replaces all the check out data, giving in correct times.
I have included screenshots and sample code, any help would be great.
Code:
Dim mySQL1 As String
If DMax("[Check Out]", "Check In/Out") >= DateAdd("n", -1, Now) Then
MsgBox "You cannot Check Out again within 1 Minute"
Else
mySQL1 = " UPDATE [Check In/Out]"
mySQL1 = mySQL1 & " SET [Check In/Out].[Check Out] = Now() "
mySQL1 = mySQL1 & " WHERE ((([Check In/Out].[Check Out])=IsEmpty([Check In/Out]![Check Out])) AND (([Check In/Out].[Childs Name])=[Forms]![Check In/Out Form]![Combo19]));"
Debug.Print mySQL1
DoCmd.SetWarnings False
DoCmd.RunSQL mySQL1
DoCmd.SetWarnings True
End If
In fact now since i have changed the code to the above the table is not updating at all with the new Now() data.