Updating a date field based on a checkbox

  • Thread starter Thread starter Colin Foster
  • Start date Start date
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
 
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.
 
Back
Top