Date field automatic fill by check mark (1 Viewer)

QueryStumped

Registered User.
Local time
Today, 05:43
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?
 

QueryStumped

Registered User.
Local time
Today, 05:43
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?
I was going to put =if ([checkbox]=True,Now(),Null)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:43
Joined
Feb 19, 2002
Messages
42,981
How did that work for you? Either use the IIf() function or use an If Then Else
 

oleronesoftwares

Passionate Learner
Local time
Today, 02:43
Joined
Sep 22, 2014
Messages
1,159
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

Top Bottom