Can't filter listBox

R

RobUCSD

With the code below I want to filter my lstBox to narrow down the available
choices for the user. Problem is, when cboFilterSupplies is clicked, the
lstBox goes blank. I've double checked everything but it still doesn't work.

Any help would be greatly appreciated. Rob
*******************************************************
Private Sub cboFilterSupplies_Click()

Me.lstChargeMaster.RowSource = "SELECT * FROM table WHERE fldChargeTypeCode
= '" & "SA" & "'"

End Sub
 
L

luanhoxung

try :
Private Sub cboFilterSupplies_Click()
Dim strSql as string
strSql = "SELECT * FROM YourTableName" & "WHERE fldChargeTypeCode = '"
& me.SA & "'"
Me.lstChargeMaster.RowSource = strSql
End Sub
 
Top