Checkbox

  • Thread starter Thread starter pas926
  • Start date Start date
P

pas926

I would like when a checkbox is checked that today's date
is automatically entered into a text box. Any help is
appreciated. Thanks, Paul
 
In the click event of the checkbox type this code. Note: the 'Checked' name
in the Private Sub part should reflect the 'name' value that is located in
the properties box under the Other tab. The CheckedDate reflects the name
for the textbox. This code assumes the textbox is located on the same form.
If the textbox reside elsewhere then the location must reflect the forms!
statement.

Private Sub Checked_Click()
If Checked = True Then
CheckedDate = Date
Else
CheckedDate = Null
End If
End Sub
 
Paul,
Sounds like a bit of overkill to me, but code the
Check Box's AfterUpdate event:

If CheckBox = -1 Then
[SomeField] = Date
End If

Or why not just enter Ctrl + ; (Ctrl Semicolon) in that field?
 
Back
Top