thread702-1579349
Hi,
I want to create a form in Access, where it is possible to clock in and clock out.
The form will contain the fields FirstName, LastName, PurposeOfVisit and the clock in and out fields will be hidden.
The purpose of the form is to log who visited a particular site and log the time in and out on the click of a button.
I tried to use the following code, from another thread:
For the In button:
DoCmd.OpenForm "frmClock", acNormal, , , acFormAdd, acDialog, "In"
For the Out button:
DoCmd.OpenForm "frmClock", acNormal, , , acFormAdd, acDialog, "Out"
For the textbox (the example only had 1 text box)
Dim strInOut as string
If Not IsNull(Me!txtEmpid) Then
strInOut = Forms!frmClock.OpenArgs
If Len(strInOut) > 0 Then
If strInOut = "In" Then
Me!txtIn = Now()
ElseIf strInOut = "Out" Then
Me!txtOut = Now()
End If
End If
End If
When pressing the button an error “invalid use of null” appears?
Does anyone know what is wrong with what I am doing? Or is there another way to accomplish the task?
Thanks
Hi,
I want to create a form in Access, where it is possible to clock in and clock out.
The form will contain the fields FirstName, LastName, PurposeOfVisit and the clock in and out fields will be hidden.
The purpose of the form is to log who visited a particular site and log the time in and out on the click of a button.
I tried to use the following code, from another thread:
For the In button:
DoCmd.OpenForm "frmClock", acNormal, , , acFormAdd, acDialog, "In"
For the Out button:
DoCmd.OpenForm "frmClock", acNormal, , , acFormAdd, acDialog, "Out"
For the textbox (the example only had 1 text box)
Dim strInOut as string
If Not IsNull(Me!txtEmpid) Then
strInOut = Forms!frmClock.OpenArgs
If Len(strInOut) > 0 Then
If strInOut = "In" Then
Me!txtIn = Now()
ElseIf strInOut = "Out" Then
Me!txtOut = Now()
End If
End If
End If
When pressing the button an error “invalid use of null” appears?
Does anyone know what is wrong with what I am doing? Or is there another way to accomplish the task?
Thanks