|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. Table: tblTest Field1: Company Field2: Location 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? Thanks, Joel |
|
#2
|
|||
|
|||
|
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 from models where manufacturerID = [passed_value] ... This will in turn populate the second combo box.
__________________
El éxito consiste en una serie de pequeñas victorias día a día MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQL Select stmt in MS Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|