Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list box multiple options 1

Status
Not open for further replies.

dvetro

IS-IT--Management
May 29, 2003
6
0
0
IN
Hello,
I am trying to create a simple list box combo. For instance, I have a list box call state in a form, in this I have values that I have entered. I also have a combo box called city. What I would like to do is populate the city box based on what is in the state box.

i.e. I tab to the state box and select TX, I would then like my city box to reflect the cities in TX and list them in the list box, such as Houston, Dallas, El Paso. If the state is NE, then list Omaha, Lincoln and so on. I am lost on how to do this. Any help would be greatly appreciated.

Thanks in advance
 
I have an example if you want me to send it to you, but basically...

1. Create the listbox called lstState based off the State Table

2. Create the Combobox called cboCity with the following as the RowSource:

SELECT [tblCity].[City], [tblCity].[State] FROM tblCity WHERE ((([tblCity].[State])=[Forms]![frmStateCity]![lstState]));

3. Add the folowing to the On Click event of the Listbox:
Me.cboCity.Requery

Ta-da....



"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?"
 
That works, thank you very much.
 
Hey Vetro -- is that you clogging up the bandwidth with inane questions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top