Hi,
I am using Access 2003, and trying to display only certain values in a combo box based on the value of another combo box. I am new to this, did some research, and understand that this may be done in 2 ways:
1) By building a querry assotiated to the RowSource property of the combo box (plus a small piece of code to trigger the "requery")
2) Through VBA (using the "AfterUpdate" event for the combo box which value I want to check to determine which values should show up in the second combo box)
First I would like to understand what would be the reason for using one option vs another.
Anyway I tried option 1 (as I thought why use VBA if not needed...) using some examples found on the web.
I have a combo box "CmbCompanyName" in my form ("Registration log") which contains a list of companies.
The next combo box in my form is called "CmbDriverName", which contains a list of drivers (each of them associated to a company).
I have a querry in my DB which called "List of drivers" which contains all drivers and the company they belong to.
Here is the SQL code in the querry builder assotiated with CmbDriverName":
SELECT
[List of drivers Query].[Name of driver]
FROM
[List of drivers Query]
WHERE (((
[List of drivers Query].[Company name])=[forms]![frmRegistration log].[CmbCompanyName]))
ORDER BY
[List of drivers Query].[Name of driver];
Problem is after selecting a value in CmbCompanyName and clicking on the drop down arrow in CmbDriverName I get an "Enter Parameter Value" pop-up window prompting me to enter a Company Name. So basically it is not using the value already selected in CmbCompanyName.
I can sense that I am probably not too far away from getting this to work but I am stuck. Any help would be greatly appretiated.
Thanks,
Plix