All,
hopefully I have posted this in the correct place.
I should explain I have very limited Access knowledge, but I have been instructed by my work to deal with this issue!
I currently have a table (tbl_topics) with 2 fields "Topics" and "Sub-Topics" I am attempting to use these to set up some cascading lists on a user form.
I have a combo box (cbo_topic) which is the first to be accessed by the user. The code i am using to define the RowSource is:
Code:
SELECT DISTINCT tbl_topics.Topic FROM tbl_topics ORDER BY tbl_topics.Topic;
Once the user has selected a topic, the sub topics field (cbo_subtopic) presents the associated sub topics. I have added the following code to the afterupdate field of the cbo_topic (through AfterEvent - Code Builder)
Code:
Private Sub cbo_Topic_AfterUpdate()
cbo_subtopic.RowSource = "Select tbl_topics.SubTopic " & _
"FROM tbl_topics" & _
"WHERE tbl_topics.Topic = '" & cbo_Topic.Value & "' " & _
"ORDER BY tbl_topics.SubTopic;"
End Sub
The first combo box is working fine, with the drop down options appearing. However there are currently no options appearing in the second combo box, and no error messages appearing.
I am more than a little lost at the moment, and attempts to find a solution online have left me with more questions than answers. Can anyone advise where I am going wrong, and how i can resolve this issue
Thanks