January 21st, 2004, 12:47 PM
SQL Select stmt in MS Access
Hello, New to SQL / Access interface so please bear with me...
I have a small (not normalized) table which has two important fields.
I am trying to allow a user to choose from previously entered data and avoid retyping. ie when a new Company is entered I want them to be able to choose from a combo box filled with previously entered Companies. I used
SELECT DISTINCT Company FROM tblTest
Worked great....Now i wish to populate the Location field combo box with ONLY valid locations associated with that company. Started with:
SELECT DISTINCT Location FROM tblTest WHERE [Company] =
and that is where I am stuck....
Question is, how do i reference the previously selected cell?
January 22nd, 2004, 12:38 AM
If you are using combo boxes you would want the selection from the first combo box to populate the second/dependent combo box. For example: I have a combo box called manufacturers and a combo box called models. When I select a manufacturer that will trigger an event passing the manufacturerID back to the database and issue the following query:
select distinc carModels
where manufacturerID = [passed_value]
This will in turn populate the second combo box.