Combo find data between dates

M

Marco

Hi. I've got a form that finds registers between dates. I've got a combo box
in that form that list all dates. Until here there's no problem. But now I
want to implement another combo box that allows choosing what year we want to
find.

Imagine, ComboBox1 has the options 2006 and 2007, if I choose 2006 in
ComboBox2 appears all results/dates of 2006 if I choose 2007 it appears all
of 2007.

I have a query that shows all dates, and ComboBox2 get data from data query.
In that query, in the column Year I put this criteria:
[forms]![Control_Dates]![Combo_Year].

This is working, but only once. If I open the form and choose 2007, it
really appears the results/dates of 2007, but after that if I choose 2006 it
doesn’t appears the results of 2006.
I have to close the form and open it again.

Can you help me?

Regards in advanced.
Marco
 
D

Douglas J. Steele

You need to put code in the AfterUpdate event of ComboBox1 to refresh
ComboBox2:

Private Sub ComboBox1_AfterUpdate()

Me.ComboBox2.Requery

End Sub
 

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

Top