Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Leicester, England
    Posts
    3

    Question Unanswered: Populating a combo box based on a selection from another

    Hiya folks

    I have a slight problem which is causing me a BIG headache, so I wondered if any one could help me out..

    On a form I have 2 combo boxes, 1 is Categories and the other is Sub Categories both get their data from seperate tables (Categories & SubCategories).

    I need to be able to populate the Sub Category combo box with the correct data depending on the choice the user made in the Categories section..

    The 2 tables are set up llike this... Categories has a unique CategoryID field and a Category (name) field. The SubCategories table has a unique SubCategoryID field, a SubCategory (name) field and a Category field which contains the unique CategoryID number from the Categories table to show which category the sub category belongs to.

    So if a user selected the Category - Relationships (CategoryID of 1) in the combo box I need the SubCategories combo box to only show all SubCategories that fall under CategoryID 1

    Thanks all

    Akash
    Last edited by Kimara; 04-25-02 at 11:32.

  2. #2
    Join Date
    Mar 2002
    Location
    Sacramento, CA
    Posts
    120
    Thanks to Roger Carlson for the attached sample Combo Box samples.

    I have used these successfully for a while now.

    Michael Abrams

    **edited to correct spelling of Roger's last name**
    Attached Files Attached Files
    Last edited by mrabrams; 04-25-02 at 14:02.

  3. #3
    Join Date
    Apr 2002
    Location
    Leicester, England
    Posts
    3
    Just wanted to say a BIG THANKS for your help, you folks are great..

    Cheers

    Akash

  4. #4
    Join Date
    Apr 2002
    Posts
    168
    Kimara,

    This is what I used before, might be different from the zip file.

    In the [Combo Category] After Update event, you put :

    [Combo Sub Category].RowSource = "select [Sub Category] from [Sub Category Table] where [Category] = [Combo Category];"

    Hope this helps

Posting Permissions

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