Combo box contents doesn't change when filtering combo box is chan

  • Thread starter Thread starter Joe M.
  • Start date Start date
J

Joe M.

I have 2 combo boxes. Combo1 contains a short list of years 2009,2010 etc
which are pulled from a table. Combo2 has the row source of a query which
uses criteria selected in Combo1. If I select 2009 in Combo1 then Combo2
shows only rows matching 2009. If I close the form and run again selecting
2010 in Combo1 then Combo2 shows only rows matching 2010. However for this
application the form must remain open and when I make a different selection
in Combo 1, Combo2 remains unchanged. I'm missing how to force Combo2 to
refresh to show the changes. Can anyone help?

Thanks,
Joe M.
 
In the afterupdate of Combo1, requery combo2.

If len(Combo1 & "") > 0 then
combo2.Rowsource = "Select * from queryname where somefield=" & combo1
Else
combo2.Rowsource = ""
End If
 

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

Similar Threads


Back
Top