Results 1 to 2 of 2
  1. #1
    donnwall0720 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Posts
    1

    Cannot Get Third Combo Box to Populate with Access / VBA

    I am very new to Access. I have gotten the hang of creating combo boxes; but...

    I have a form in which I am trying to populate data for three cascading combo boxes.

    I want to have user select a category and then select a Product from that category and then have a list of carriers (of the products from the categories) be populated.

    I can get the first two to populate, but get nothing to show in the third.

    The three combo boxes are (in order):

    1. cboCategories
    2. cboProducts
    3. cboCarriers

    The table is the Products table.

    Here is a summary of the elements used:

    3 combo boxes


    COMBO BOX 1:
    Unbound combo box name: cboCategories
    In Properties, the rowsource is the table Categories

    For Event / After Update, there is this:
    Private Sub cboCategories_AfterUpdate()

    Me.cboProducts.RowSource = "SELECT DISTINCT ProductName FROM " & _
    " Products WHERE CategoryID = " & Me.cboCategories & _
    " ORDER BY ProductName"

    Me.cboProducts = Me.cboProducts.ItemData(0)

    End Sub


    COMBO BOX 2:
    Unbound combo box name: cboProducts
    There is no rowsource information in the Properties

    For Event / After Update, there is this:

    Private Sub cboProducts_AfterUpdate()

    Me.cboCarriers.RowSource = "SELECT Carriers FROM " & _
    " Products WHERE CategoryID = '" & Me.cboCategories & "' AND " & _
    "ProductName = '" & Me.cboProducts & "' '" & _
    "'ORDER BY Carriers"

    Me.cboCarriers = Me.cboCarriers.ItemData(0)

    End Sub


    COMBO BOX 3:
    Unbound combo box name: cboCarriers
    There is no rowsource information in the Properties.


    There is nothing for Events / After Update



    I HOPE YOU CAN APPRECIATE THAT I KNOW FAIRLY LITTLE ABOUT THIS PROCESS; HOWEVER, I AM HOPING SOMEONE CAN GIVE ME GUIDANCE SO THAT I CAN MAKE THE THIRD COMBO BOX POPULATE.

    ANY HELP WOULD BE GREATLY APPRECIATED.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    There are free video tutorials at http://www.datapigtechnologies.com/AccessMain.htm

    Look for those that deal with COMBOBOX

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

Similar Threads

  1. Replies: 33
    Last Post: 01-13-2012, 07:44 AM
  2. Populate combo box with Record Set in Access 2003
    By ganeshvenkatram in forum Access
    Replies: 2
    Last Post: 06-20-2011, 04:10 AM
  3. Replies: 4
    Last Post: 01-24-2011, 07:11 PM
  4. Use Combo Box to Populate Form
    By gracysaurus in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 02:40 PM
  5. Populate Combo Box
    By wes28 in forum Programming
    Replies: 1
    Last Post: 03-04-2009, 06:45 AM

Tags for this Thread

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