Results 1 to 2 of 2
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Trouble with vba code for cascading combo boxes

    I can't seem to get the syntax right for these cascading combo boxes.



    I'm using these 2 tables

    congregations - fields are Congregation_ID_PK, CongregationName, CongregationAddressID
    individuals - fields are Individual_ID_PK, firstname, lastname, email, Congregation_ID_FK, teams_ID_FK

    I need a combo box on congregations, then a second combo box on individuals in that congregation.

    I got help with a similar situation, but am still struggling with the syntax.

    Your help will be greatly appreciated!!!

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    rowsource for congregation combo - called cboCongregation

    Code:
    SELECT Congregation_ID_PK, CongregationName FROM Congregations ORDER BY CongregationName


    rowsource for individuals combo - called cboIndividual

    Code:
    SELECT
    Code:
    Individual_ID_PK, firstname & " " & lastname as iName FROM individuals WHERE Congregation_ID_FK=[cboCongregation]
    

    in the cboCongregation combo after update event put


    Code:
    cboIndividual.requery


    Note the above is for 2 combos on the same single form

    If you need more help, provide more information such as what you are actually using, a full description of your form and any subforms and where those combo's are located

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

Similar Threads

  1. Cascading Combo Boxes
    By Anil Bagga in forum Access
    Replies: 7
    Last Post: 04-21-2020, 04:25 AM
  2. Code for cascading combo boxes
    By MGF23 in forum Access
    Replies: 4
    Last Post: 01-19-2018, 08:16 AM
  3. Cascading Combo Boxes
    By Lou_Reed in forum Access
    Replies: 20
    Last Post: 12-20-2016, 01:50 PM
  4. Replies: 9
    Last Post: 04-04-2014, 03:30 PM
  5. Cascading Combo Boxes trouble
    By Monterey_Manzer in forum Access
    Replies: 4
    Last Post: 09-13-2012, 11:06 AM

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