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