B
Beeyen
Good Day,
I am trying to have a checkbox to enter the date and time [Now ()] into a
field and if the box is not check then it remains blank. The coding I have
place in the After Update is noted below, but when I check the box I receive
“You tried to assign the Null value to a variable that is not a variant data
typeâ€. I click “Okâ€, a check appears in the checkbox along with the date and
time. When I try to deselect the checkbox I receive the VB error box –
Runtime error ‘2164’
You can’t disable a control while it has the focus.
Can anyone assist?
Private Sub ASSIGNEDCHECKBOX_AfterUpdate()
If Me.[ASSIGNEDCHECKBOX] = True Then
Me.[Assigned Date/Time] = Now()
Else
Me.[ASSIGNEDCHECKBOX].Enabled = False
End If
End Sub
I am trying to have a checkbox to enter the date and time [Now ()] into a
field and if the box is not check then it remains blank. The coding I have
place in the After Update is noted below, but when I check the box I receive
“You tried to assign the Null value to a variable that is not a variant data
typeâ€. I click “Okâ€, a check appears in the checkbox along with the date and
time. When I try to deselect the checkbox I receive the VB error box –
Runtime error ‘2164’
You can’t disable a control while it has the focus.
Can anyone assist?
Private Sub ASSIGNEDCHECKBOX_AfterUpdate()
If Me.[ASSIGNEDCHECKBOX] = True Then
Me.[Assigned Date/Time] = Now()
Else
Me.[ASSIGNEDCHECKBOX].Enabled = False
End If
End Sub