reset listbox

qwertyjjj

Registered User.
Local time
Yesterday, 22:40
Joined
Aug 8, 2006
Messages
262
I have the following code, which changes the items in the listbox depending on another box in the form.
Form.RecordSource = "CreditControllerSpecific"
combo_CostCentreLevel.RowSource = "SELECT 'All Profit Centres' FROM Structure UNION SELECT DISTINCT CostCentre FROM tblCostCentres WHERE CreditConName ='" & cmb_CredConName & "'"
'

The rowsource works correctly but it doesn't refresh itself when I select something else in the other box.
Is there a way to reset the index back to 0 ?
 
In the other box's _Change() event, do the following to refresh the list:
combo_CostCentreLevel.Requery


If you want to reset the listbox's value completely:
lstListBoxName.Rowsource = ""
lstListBoxName.Requery
 

Users who are viewing this thread

Back
Top Bottom