Select/deselect a Yes/No control based on a date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I select/deselect a Yes/No control based on a date control on the
same form. Based on the research I've done through the discussion board. I
think the AfterUpdate procedure on the date control is where I should place
my code. If the date is 30 days passed the Current Date() the Yes/No should
be false. I would greatly appreciate the code structure to make this happen.

Thanks In Advance
kw
 
You are correct... you will want to put the code in the AfterUpdate event of
the date control. You've basically already written the code with your
explanation. Of course you will want to replace my control names with the
actual ones:

Private Sub txtDate_AfterUpdate()
If Me.txtDate < Date() - 30 Then
Me.chkYesNo = False
Else
Me.chkYesNo = True
End If
End Sub
 
Back
Top