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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

coding a combobox afterupdate event

Status
Not open for further replies.

jminn0311

Technical User
Jan 7, 2004
66
US
I need some help coding a combobox to compare against a query to see if the date of the combobox selection is 365days more than the maxdate of of the same combobox selection in the table.

I have the query that produces the maxdate for each episode of the combobox selection. Now I need help coding the afterupdate event to compare the combobox selection's date on the form against the maxdate value of the query. I will make an attempt to show you what I am trying to accomplish.

Query
Field1 Field2
Dog 12/5/04
Cat 12/5/02

Form
ComboBox DateBox
If I select

Cat 1/12/05

I need to know if it has been more than 365 days since I last selected cat.

Does anyone have any ideas on how to accomplish this?

Thank you in advance for help and replies

Jeff
 
If Nz(DMax("Field2","QueryName","[Field1] = '" & Me.ComboBox1 & "'"),#1/1/1900#) > (Me.ComboBox2 - 365) Then
' What do you want to do?
Else
' What don't you want to do?
End If

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top