Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Expired cancel check box??

Status
Not open for further replies.

hdat44

Technical User
Aug 15, 2002
50
GB
How can i get a date field if it is older that 12 months to have the corresponding check box value change to unchecked?? i have tried the following code to no avail, any help welcome please

Private Sub Form_Current()
If Date1 Is LessThan.DateAdd("m", 12, Now()) Then
ChkBox1.Value = False
End If



End Sub
 


Code:
Private Sub Form_Current()
If Date1 < DateAdd("m", -12, Now()) Then
  ChkBox1.Value = False
End If

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I'm not sure why you are using any code. This should only be necessary if the check box is bound. If it is bound to a field then I would have to ask why store a calculated field.

If it is not bound, you should be able to set its control source to:
Code:
  =[Date1] < DateAdd("m", -12, Date())

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top