Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011

    Unanswered: Combo box values based on preceding choice

    Hi, I'm trying to set up a couple of Combo Boxes on a form in Access 2007 as follows:

    The first Combo Box has a defined list of values, so the user has to select one of these from the dropdown. e.g Customer, Supplier, Contractor.

    What I want is for the second Combo Box to fill with all the possible values of the "Name" field for the appropriate table, based on the selection made in the first box.

    So if the user selects Customer, then in the second Combo Box the available values that can be selected are each of the "Name" values from the Customers table.

    (I was thinking of just having it check to see if a typed Name exists, but then figured that having each available name as an option was far better- we want to force users to pick a name that already exists in the relevant table)

    I tried playing with the AfterUpdate event of the first Combo Box but all this does is create an Event Procedure which then waits for me to insert some appropriate code. But I can't figure what code should actually be added in there- and if any should be added into the second box as well. Any ideas?

  2. #2
    Join Date
    Apr 2005
    Zagreb - Croatia
    Look at "DemoCustomerCBoxA2000.mdb" (attachment, zip).
    Open Form1 and try.
    I think it is what you need. Look at VBA.
    Attached Files Attached Files

  3. #3
    Join Date
    Mar 2011
    Sorry, but that file wouldn't open- I unzipped it, added an MDB extension (it didn't have a file extension) but Access said it was an unrecognized file format.

  4. #4
    Join Date
    Mar 2009
    Provided Answers: 14
    As advised by pkstormy, add this site to the list of trusted sites in the security settings of your browser, then try again.
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts