| | |
Lookup column based on selection
Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hi, I am new to Access 2007. I have two columns in my table, Make and Model. The Make column is a lookup from a Makes table which has different makes of computer (Dell, Toshiba, etc...) in it. I also have a Model column adjacent to it which is set up in a similar way, it looks up to a table named Models and has different model names (Satellite, Dimension, etc...).
Is there any way so that when I select a Make, that when I go to choose the Model, only the models from the particular Make are displayed? For example, if I select DELL as the Make, only the Dell models are available as a choice in the Model column?
I have tried to make a query, but I don't think it is what I am going for.
Thank you for your help in advance!
Is there any way so that when I select a Make, that when I go to choose the Model, only the models from the particular Make are displayed? For example, if I select DELL as the Make, only the Dell models are available as a choice in the Model column?
I have tried to make a query, but I don't think it is what I am going for.
Thank you for your help in advance!
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
From your post, it sounded as if you used the table directly to enter and view data. I would recommend that you use a form to modify and view the data.
With the form, you can add a make combo box and a model combo box. When someone selected the make, you can change the row source of the model combo box to display only the units by that company. That should get you in the right direction; let me know if you need additional details.
With the form, you can add a make combo box and a model combo box. When someone selected the make, you can change the row source of the model combo box to display only the units by that company. That should get you in the right direction; let me know if you need additional details.
Thank you, this clarifies this a lot! I will try your suggestion out and see how it goes.
How do I change the row source of the Model combo box dynamically (that is, when the Make combo box changes)?
How do I change the row source of the Model combo box dynamically (that is, when the Make combo box changes)?
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
Here is my SQL for the Makes combo box:
Combo182 is the combo box on my form which corresponds to the Make field.
SELECT Models.[Model Name] FROM Models WHERE (((Models.Make)=[Combo182])) ORDER BY Models.[Model Name];
Combo182 is the combo box on my form which corresponds to the Make field.
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
What I had in mind was to use the On Change event of Combo182 to update the Row Source of the Model combo box.
Hmmm...Thank you for the suggestions so far. How do I go about doing that?
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
Are you familiar with VBA? If so, the code you need should be something along the lines of this:
Please note that this code assumes the combobox for the model is combo183.
Private Sub Combo182_Change() Combo183.rowsource = "SELECT Models.[Model Name] FROM Models WHERE (((Models.Make)=" & Me.Combo182 & ")) ORDER BY Models.[Model Name]" End Sub
Please note that this code assumes the combobox for the model is combo183.
Thank you, you have been a huge help!
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
![]() |
Similar Threads
- populate one dropdown based on selection in another dropdown (ASP.NET)
- need to populate the single column out of mulitple colums, (ASP.NET)
- populating dropdownlist based on gridview selection (ASP.NET)
- Dynamically pass column value to database based on radio button selection (ASP.NET)
- Dynamic population of second list box based on the selection of first list box from s (JavaScript / DHTML / AJAX)
- Requiring selection in form based on previous question selection (HTML and CSS)
- Am not able to get a radio button selection to display in output (PHP)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: AutoNymber datatype in ACCESS
- Next Thread: mulitple search queries to display records from access database
| Thread Tools | Search this Thread |
2005 access add ado.net append array c# cache code combo conficker connection control data database datagrid datagridview dbconnection dropdownlist files government htaccess internet ip limit login lookup mal malware module ms mysql net oracle position record reuse security service site sql sqlserver table users vb vb.net virus web website windows






