Looking for help on cascading combo boxes
I have two tables: tclient and tmatter. The tables share a common key based on the clientId.
I have a form with two combo boxes cmbMatterNo for the matter name and cmbClientSearch for the client name. When I select an item from the cmbMatterNo it runs a query on the tmatter table that returns the clientID and the matterNo, with the clientID being the bound column. I want to synch the cmbClientName based on the selection of the matterNo in the cmbMatterNo combobox,
I have written the following code:
cmbClientName.RowSource = "SELECT tClients.ClientID, tClients.ClientName " & _
"FROM tClients " & _
"WHERE tClients.ClientID = '" & cmbMatterNo.Value & "' " & _
"ORDER BY tClients.ClientName;"
When I select the cmbMatterNo item it returns the clientID as the cmbMatterNo.Value, but the cmbClientName box nevertheless is empty and does not show any of client name from the tclients table.
Any help on what I am doing wrong would be greatly appreciated.
Thanks.