Clearing a listbox (1 Viewer)

mumbles10

Registered User.
Local time
Today, 15:57
Joined
Feb 18, 2011
Messages
66
hello... I have two comboboxes... cboChoiceName is based on a query... when you select an item it populates cboChoiceSys. When you make a selection it populates lboEntitlements. My problem is when I change a selection in cboChoiceName, cboChoiceSys goes back to (0) and I can make a selection. However, the listbox retains the information from the previous selection until I make a selection in cboChoiceSys... any suggestions...

Option Compare Database

Private Sub cboChoiceName_AfterUpdate()
Me.cboChoiceSys = Null
Me.cboChoiceSys.Requery

End Sub


Private Sub cboChoiceSys_AfterUpdate()
Me.lboEntitlements = Null
Me.lboEntitlements.Requery


End Sub
 

John Big Booty

AWF VIP
Local time
Tomorrow, 05:57
Joined
Aug 29, 2005
Messages
8,263
Add this line;
Code:
Me.lboEntitlements.Requery
to the After Update event of cboChoiceName. With a set of cascading combo/list boxes you need to requery all combo/lists that cascade from the one being changed not just the one directly effected.
 

mumbles10

Registered User.
Local time
Today, 15:57
Joined
Feb 18, 2011
Messages
66
Awesome... thanks a lot.

I thought I had tried that initially... but I guess I didn't.

You rock!
 

Users who are viewing this thread

Top Bottom