I am still having problems with my cascading combo boxes.
I have 3 boxes: cboClientName, cboMatterName, and cboMatterID. CboClientName looks to a client table with client names which each have a unique clientID. CboMatterName and cboMatterID are drawn from a matters table which associates matters names and unique matter ids with the client's id.
I have the following code to select the client name in a combobox and then limit a second combobox to only those matters associated with that client id. I have written the following code to do so in the private sub cboClientName_AfterUpdate():
cboMatterName.RowSource = "SELECT ClientID, MatterName FROM tMatters WHERE ClientID = [cboClientName] ORDER BY MatterName;"
Me.cboMatterName.Requery
The second combobox (cboMatterName) populates perfectly with a restricted list of the matters for that client and I scroll through the list. However, regardless of which matter name I select, the cboMatterName combobox selects and shows only the first matter.
I have checked and the form is set to "Allow edits - Yes" and the comboboxes are all set to "Enabled - Yes" and "Locked - No".
Can anyone tell me what I am missing here and why the second combobox seems to lock on the first value no matter which name is selected? Ultimately I trying to get to the point, where the selection in any one of the comboboxes auto-populates the other two, but all comboboxes remain changeable at anytime.
Thanks for your help.