I have a combo box that changes its contents based on the selection of a value in another combo box using this code:
Me.sTopic.RowSource = "SELECT SubTopic FROM SubTopics WHERE Topic = " & Me.mTopic & " ORDER BY SubTopic"
Me.sTopic = Me.sTopic.ItemData(0)
In other words, when one selects a topic from the 'Topics' combo box, the 'SubTopics' combo box then gets a list of sub topics appropriate to the main topic.
However, I have a couple of problems. Firstly, when a new record is started the list of sub topics doesn't change. The Topic changes back to the first topic in the topics table, but nothing happens to the subtopic box.
Secondly, the combo box doesn't store it's field in the overall record. Whatever selection you make in the combo box, nothing gets stored. I wonder if it's because the control source is set to 'unbound' but if I change it to 'subtopic' it gives me an error of invalid value whenever I change the 'topic' in the top box.
Help greatly appreciated!