Show date in field when checkbox is checked

A

Arjan

Hi all,

When a certain checkbox is checked, I would like to show a date (the date of
chekking) in a textbox..

How can I do this?

Arjan
 
A

Al Campagna

Arjan,
You'll need to add another field (Date Type ex. CheckDate) to your table to hold the
date value. On the AfterUpdate event of the ChkBox...
If ChkBox = True Then
CheckDate = Date
Else
CheckDate = Null
End If

A very minor point...
That will work, but the checkbox is a bit redundant. The presence (true) or absence
(false) of a Date in the CheckDate field would in itself serve the same purrpose as a
True/False checkbox. Ex. A project could be "Complete" if it has a date in Checkdate, and
"Incomplete" if Null.
You could add a CheckDate field to your table, and drop the checkbox. Using a
Dbl-Click on CheckDate could cause the Date to be entered there, and another dbl click
would cause CheckDate to go Null... like a toggle.
Having both a checkbox and date field is by no means a big deal, or a problem... you
certainly can have both. I just wanted to point out that "logically" it's a bit
redundant.
 
Top