Hello, I'm trying to clear a listbox when the user unchecks a checkbox. It populates just fine when there's a check in the box, but I can't get the list box to clear when there is no check in the box. What happens is that whatever populated when it was check stays there when it's unchecked... nothing changes.
I've tried this (as suggested in other threads) as well and nothing.
Me![lstStates].RowSource = ""
Any help would be appreciated. Thanks.
Code:
Private Sub chkLimitGrp_AfterUpdate()
'MsgBox chkLimitGrp
If chkLimitGrp = True Then
'MsgBox "populating listbox"
Me![lstGroups].RowSource = "SELECT DISTINCT rpt_cust_name FROM tbllob ORDER BY rpt_cust_name;"
Me![lstGroups].Requery
Else
MsgBox "clearing listbox"
Me![lstStates].RowSource = "SELECT rpt_cust_name FROM tbllob WHERE 1 = 2;"
Me![lstStates].Requery
Me.Refresh
End If
End Sub
I've tried this (as suggested in other threads) as well and nothing.
Me![lstStates].RowSource = ""
Any help would be appreciated. Thanks.