Syntax Help

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

Guest

This line of code works perfectly;

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

The line below does not. I'm trying to filter on multiple criteria and then
sort the results.

Any help would be greatly appreciated. Thank, Rob


Me.lstChargeMaster.RowSource = "SELECT * FROM tblChargeMaster " & _
"WHERE fldChargeTypeCode = 'SA' AND 'SAD'" & _
"ORDER tblChargeMaster.fldAlternateDescription"
 
Me.lstChargeMaster.RowSource = "SELECT * FROM tblChargeMaster " & _
"WHERE fldChargeTypeCode IN('SA', 'SAD') "
 
Thank you Dave. As you can tell I'm a total rookie here. Can you help with
the order by statement at the end of the line you just provided? Thanks, Rob
 
Me.lstChargeMaster.RowSource = "SELECT * FROM tblChargeMaster " & _
"WHERE fldChargeTypeCode IN ('SA', 'SAD') " & _
"ORDER BY fldAlternateDescription"
 

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

Similar Threads

Help with creating variables/routine 4
Can't filter listBox 2
MVP's; Please Help 3
Access Dcount (multiple criteria) 3
getting subform information 2
More Sql Help 3
Cascading Combo Box Help! 2
SQL Statement within VB Code 3

Back
Top