Auto fill today's date when checkbox checked

  • Thread starter Thread starter Sunflower
  • Start date Start date
S

Sunflower

Newbie question...

I have a checkbox and a date field in a subform...
How do I auto fill the date field with today's date when the checkbox
gets checked?

All help much appreciated
 
Hi Sunflower,

In the after update event of the checkbox put code like this-->

Private Sub Me.NameOfCheckbox_AfterUpdate
If Me.NameOfCheckBox = True Then
Me.NameOfDateControl = Date()
End If
End Sub


Note: replace the obvious with the correct control names


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Hi Sunflower,

In the after update event of the checkbox put code like this-->

Private Sub Me.NameOfCheckbox_AfterUpdate
If Me.NameOfCheckBox = True Then
    Me.NameOfDateControl = Date()
End If
End Sub

Note: replace the obvious with the correct control names

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia








- Show quoted text -

Thank you...works beautifully!!
 
What if the check box checked automatically?
I mean it already has an expression to be checked once other check boxes are checked?
Because in that way, the after update event doesn't work, since it's read only.
 
Back
Top