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

Combo box options based on result from another field

Status
Not open for further replies.

carolla

Technical User
May 14, 2004
15
0
0
CA
Is it possible to choose an item from a combo box in one field and have the choices updated in another combo box. For example, if I choose a Type Of Equipment from one combo box, can my options to choose from in Make and Model combo boxes be linked to my first choice?
 
carolla,

Yes. What application? What object is the parent of the combobox?

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
I am in a MS Access form for tracking communications equipment. The parent field is the combo box "Type" (ie. pager, base, mobile, portable). One of the combo boxes that I would like attached is the "Make" field (Motorola, Kenwood...). Pagers have certain makes, with base, mobile, portable having what would be a different list. I could make one large list for the combo box, but I thought there would be less room for error if employees only had the proper choices.
Carol
 
You might try posting in forum705: Microsoft: Access Modules (VBA Coding).

Skip,
[sub]
[glasses] [red]Be advised:[/red] It's been reported that a wee psychic is roaming the countryside.
Small Medium @ Large! [tongue][/sub]
 
I don't know....it does not seem to be particularly an Access question. It is a conditional logic question regarding controls. The controls are not specific to Access.

Yes, you can make the contents of one field be changed by the value of another.

Why not?

Say two comboboxes - combobox1, and combobox2. With the combobox1_change event:

1. have arrays of possible values for combobox2.

2. do a Select case on the value of combobox1, determining which array to load into combobox2

3. perform a .Clear on combobox2 to remove all existing items

4. do .AddItem on combobox2, loading each item from the determined array

Hope this helps.


Gerry
 
Are you using a table/query or a value list as the data source for your combo box?

Do you have a table of the types and a table of the makes?

You can accomplish what you are trying to do. I just need more info to be able to help.

 
In the AfterUpdate event procedure of the 1st combo dynamically build the SQL instruction of the RowSource property of the 2nd combo.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Tigerlili3
I have the Type, Make, and Model fields in the same table (tbl_radio). The Type field has a value list as the data source for the combo box of the different types of communications equipment. The Make and Model fields do not have any lists associated to them yet.
Carol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top