synchronizing Combo boxes

J

Jeremey Kenney

I cannot seem to get my combo boxes to properly Sync up. Im not sure if the
code i am entering is wrong or what the deal is. Can someone help me out? I
have two tables State and Countydocs. I am trying to make it so when the
user uses the first combo box(cbostate) to pick a state, the counties for
that state would populate in the second combo box(cbocountydoc). Once they
pic a county I want to put a search button on there to pull up the documents
for that selected. county. I can get the cbostate box to show the states but
it will not populate the county info. can someone please help?

thanks!
 
D

Daryl S

Jeremey -

In the AfterUpdate event of the first combo box, requery the second combo
box, something like this (use your form and control names):
Forms!YourFormName!CountyComboBoxName.Requery

The County combo should be set up with a row source that pulls only counties
for the state in the first combo box. This row source should look something
like this (use your form, table, field, and control names):

SELECT Counties.County, FROM Counties WHERE
(((Counties.State)=Forms!YourFormName!StateComboBoxName.value)) ORDER BY
Counties.County;
 

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