Guest_imported
New member
- Jan 1, 1970
- 0
I have a listbox whose choices should change based on the value selected in another listbox. The onchange event for the independent listbox alters the SQLText of the dependent listbox's list source. However, when I change the independent listbox, nothing happens in the dependent list.
I am confident that the recordset is getting changed correctly because (for testing purposes) I also created a grid using the same recordset, and it updates as I would expect.
Is it not possible to dynamically change the contents of a dropdown listbox?
Here's the code I'm using:
Sub lstAgency_onchange()
if rsOperator.isOpen() then rsOperator.close
rsOperator.setSQLText "SELECT OperName, OperID FROM ELI_Operators WHERE AgencyID = " & lstAgency.getValue()
rsOperator.open
End Sub
Thanks in advance for any responses.
I am confident that the recordset is getting changed correctly because (for testing purposes) I also created a grid using the same recordset, and it updates as I would expect.
Is it not possible to dynamically change the contents of a dropdown listbox?
Here's the code I'm using:
Sub lstAgency_onchange()
if rsOperator.isOpen() then rsOperator.close
rsOperator.setSQLText "SELECT OperName, OperID FROM ELI_Operators WHERE AgencyID = " & lstAgency.getValue()
rsOperator.open
End Sub
Thanks in advance for any responses.