Combo box

  • Thread starter Thread starter gizmogwaisan
  • Start date Start date
G

gizmogwaisan

Guest
Please help me...

I have two tables, City and State. In CITY table-CityID as Primary Key and StateID as foreign key. State ID is the primary kay of STATE table. I want to have 2 combo box in my form, one for STATE list and another for CITY. How should I do it so that when I choose eg. State1 in the first combo box, the second combo box will display only the city in State1.

Thanks in advance.
 
This is how I do it in one of my databases.

1. In the ON CHANGE of the State combo box, I put code to set the rowsource of the city combo box to a SQL statement (or you could set up a query) that selects those cities that belong to that state.

2. then I use the requery (cmbCity.Requery) to update the city box.
 
Bob,

I'm trying to do something similar. Could you send me that code? awu2@cornell.edu

Thanks,
Andreas
 

Users who are viewing this thread

Back
Top Bottom