Results 1 to 2 of 2
  1. #1
    Plix is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2013
    Posts
    1

    Cascading combo box


    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

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Here is a tutorial to follow:

    http://www.fontstuff.com/access/acctut10.htm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cascading Combo from Main to Sub
    By libraccess in forum Forms
    Replies: 1
    Last Post: 07-01-2012, 01:03 PM
  2. Dynamic Cascading Combo Box
    By Userdd in forum Forms
    Replies: 5
    Last Post: 07-24-2011, 07:37 PM
  3. Cascading Combo Box Help
    By euphoricdrop in forum Forms
    Replies: 3
    Last Post: 04-12-2011, 05:35 PM
  4. cascading combo
    By rexb in forum Forms
    Replies: 9
    Last Post: 10-26-2009, 04:10 PM
  5. Cascading Combo Box
    By nywi6100 in forum Forms
    Replies: 0
    Last Post: 10-23-2006, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums