Can't filter listBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
try :
Private Sub cboFilterSupplies_Click()
Dim strSql as string
strSql = "SELECT * FROM YourTableName" & "WHERE fldChargeTypeCode = '"
& me.SA & "'"
Me.lstChargeMaster.RowSource = strSql
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top