Results 1 to 2 of 2
  1. #1
    agripa86 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    3

    Exclamation Access 2003 - cascading combo box issues

    Hi,

    I'm new to the forum, so hope I have posted this in the correct place.

    All,

    I am fairly comfortable with VB in excel, but have previously attempted to avoid Access as much as possible!

    I have a database with data entry form, and I am attempting to implement some cascading combo boxes, with limited success.

    The structure is below

    I currently have a table with my topics which I am using to populate the first combo box (cbo_Topic) . The item selected here then impacts the contents of the next 2 combo boxes. Each of the topics in this list relates to a seperate table which features subtopics (only 1 column in each table)



    Once the user has selected the topic, they will then be able to select 2 subtopics from the next 2 combo boxes (cbo_subtopic) and (cbo_subtopic2)

    The entries selected in all of these fields are then stored in a further table

    I have input the first combo box, and that is populating correctly, but the cascade isn't. I have left the row source of the sub topic combo boxes blank, and I have inserted the code below (i am aware this is only for 1 combo box - was trying to get one working before i started the second! into the After Update event of the topics combobox (as run code) however this doesn't seem to be working.

    I have been trying various solutions for the past 5 days, and my deadline is getting close - any ideas?


    Code:
    Private Sub CBO_Topic_Afterupdate()
    On Error Resume Next
    Select Case cbo_topic.value
    Case "Disabilities"
    cbo_subtopic.Rowsource = "Subtopics_Disabilities"
    Case "Diseases, Illnesses and Conditions"
    cbo_subtopic.Rowsource ="Subtopics_Diseases,Illnesses and conditions"
    Case "General Health and Wellbeing"
    cbo_subtopic.Rowsource = "Subtopics_General HEalth and Wellbeing"
    Case "Medicines, Drugs, Treatments and Therapies"
    cbo_subtopic.Rowsource = "Subtopics_Medicines, Drugs, Treatments and Therapies"
    Case "Mental Health and Counselling/Emotional"
    cbo_subtopic.Rowsource = "Subtopics_Mental Health"
    Case "Nutrition, Food and Diet"
    cbo_subtopic.Rowsource = "Subtopics_Nutrition"
    Case "People Groups"
    cbo_subtopic.Rowsource = "Subtopics_People Groups"
    Case "Practical Help and Services"
    cbo_subtopic.Rowsource = "Subtopics_Practical Help"
    Case "Pregnancy, Childbirth and Children"
    cbo_subtopic.Rowsource = "Subtopics_pregnancy"
    Case "Sexual Health"
    cbo_subtopic.Rowsource = "Subtopics_Sexual health"
    Case "Social Care and Provisions"
    cbo_subtopic.Rowsource = "subtopics_Social Care"
    Case "Violence, Crime and Abuse"
    cbo_subtopic.Rowsource = "subtopics_Violence"
    End Select
    End Sub

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    The idea of a combo box selection affecting the second coombo box is called Cascading Combo boxes. There are free video tutorials here.
    http://www.datapigtechnologies.com/f...combobox1.html
    http://www.datapigtechnologies.com/f...combobox2.html

    Good luck

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

Similar Threads

  1. Populate combo box with Record Set in Access 2003
    By ganeshvenkatram in forum Access
    Replies: 2
    Last Post: 06-20-2011, 04:10 AM
  2. Access 2003: Many to many combo box
    By compooper in forum Forms
    Replies: 1
    Last Post: 06-17-2011, 04:07 PM
  3. Replies: 12
    Last Post: 06-14-2011, 01:42 PM
  4. Replies: 3
    Last Post: 01-28-2011, 11:42 AM
  5. Replies: 2
    Last Post: 05-19-2010, 02:01 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