Date field automatic fill by check mark

QueryStumped

Registered User.
Local time
Today, 00:53
Joined
Mar 22, 2017
Messages
60
Hello, I am needing help with a request. I have a form that has a checkbox along with a date field. I am needing the date field to automatically populate with the days date, if the checkbox is marked. Do I put a formula in the after update of the checkbox property?
 
Hello, I am needing help with a request. I have a form that has a checkbox along with a date field. I am needing the date field to automatically populate with the days date, if the checkbox is marked. Do I put a formula in the after update of the checkbox property?
I was going to put =if ([checkbox]=True,Now(),Null)
 
How did that work for you? Either use the IIf() function or use an If Then Else
 
Set default value of checkbox to 0

Under the after update event of checkbox write either of the following codes

If Me!checkbox.Value = True Then
date.text = Now()
Else
date.text =""
End If
End Sub


OR you can write this code instead after the update event of checkbox
If Me.checkbox = -1 Then
date.text = Now()
Else
date.text =""
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom