Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Listbox DTC List?

Status
Not open for further replies.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top