Checkbox

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
 
G

GVaught

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
 
F

Fredg

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?
 

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