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
 
Jason

Works perfectly! Thanks for everything and the words of encouragement.

kw
 

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

Back
Top