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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop-Down Selection that Alters Form

Status
Not open for further replies.

smichener

Technical User
Sep 24, 2001
25
US
I need to create a form on which a selection can be made from a drop-down menu which will in turn change the rest of the fields on the form. An example would be a form with two drop-downs (a State drop-down and a County drop-down), If a user selects Texas then the County drop-down would change so that it is poplulated only with Texas counties. Any suggestions that might set me on the correct path would be much appreciated.
 
For the sake of performance here is what I would recommend.

Set your first combobox up so it will provide you the unqiue state names that you need from a table (This will help the performance).

For the second combobox build a query where the first field is your county names and the second is the state field. For the criteria use the name of the first combo box field.

The way the criteria would look for the state would be -

Forms![<The Name of the Form>]![<Name of State ComboBox>]


Hope this help you.


Steve
 

It would depend on what your drop downs have to do. According to your state/county example, you can do the following:

Create a table with states and counties.

First drop down can list all the states:
&quot;Select distinct States from tblStates&quot;

Then on the &quot;OnChange&quot; event of the drop down, run the following recordsource of the second drop down:

&quot;Select * from tblStates where State = &quot; & dropdown1
 
Thank you very much, both of you. That's all I needed to get going.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top