Updating a date field based on a checkbox

C

Colin Foster

Hi everyone,
On a form I have a checkbox to indicate whether or not an action has been
performed. If it has and the checkbox is ticked I need to update an "action
taken on" date field with "today"s date. However, I also need to be able to
change that date if I am playing "catch up" in other words, on ticking the
checkbox todays date is input into the date field which I can then overtype.
Obviously, tomorrow I still need the date to show the final inputted date
(ie "todays date" as of yesterday or my manually input date)

Any suggestions?
Regards
Colin Foster
 
G

GVaught

Against the Checkbox Click Event write the following code:

If Checked = True Then
DateFieldName = Date
Else
DateFieldname = Null
End If

Note you could also use Now to capture the time with the date. Also the
statement after the Else statement will set the DateField to Null or empty
if the box is unchecked. You can leave the Else statement off and stop with
the End If statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top