reset listbox (1 Viewer)

qwertyjjj

Registered User.
Local time
Today, 03:26
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 ?
 

modest

Registered User.
Local time
Today, 06:26
Joined
Jan 4, 2005
Messages
1,220
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

Top Bottom