Drop Down, Question

jonnyh26

New member
Local time
Today, 14:03
Joined
Mar 19, 2009
Messages
2
i am looking for some help, i have a database which has various locations on like below:

Country:
england
ireland
wales

City
manchester
dublin
wales

what am looking to do is when england is selected from the country field via a drop down then it will display manchester in the next drop down box

if this makes sence to anyone help would be great :D :)
 
The way you've shown it, each country will only ever have one city. Is this true? Or do you want to just change the City dropdown to only show cities for the chosen country?

For the first option, you can have the city as a second column (possibly hidden, ie column width=0) in the Country dropdown, then make the City box a locked text box with a recordsource of [CountryBox].Column(2). Note that column numbers start from 0, so if you have Country Code, Country Name, City Name, then City Name would be Column(2).

For the second option you need to change the recordsource of the City dropdown to have CountryCode=forms![FormName]![CountryBox], then in the AfterUpdate of the country box you need the command Me![CityBox].Requery.
 
The way you've shown it, each country will only ever have one city. Is this true? Or do you want to just change the City dropdown to only show cities for the chosen country?

For the first option, you can have the city as a second column (possibly hidden, ie column width=0) in the Country dropdown, then make the City box a locked text box with a recordsource of [CountryBox].Column(2). Note that column numbers start from 0, so if you have Country Code, Country Name, City Name, then City Name would be Column(2).

For the second option you need to change the recordsource of the City dropdown to have CountryCode=forms![FormName]![CountryBox], then in the AfterUpdate of the country box you need the command Me![CityBox].Requery.

Yes there will be more then one city in each country, will this change what you have just quoted ??
 

Users who are viewing this thread

Back
Top Bottom