Hello, I am building the 'Where' part of a string from a list box selection and am having some trouble with the AND portion where I want two use two criteria. The Column numbers are correct. It seems to be picking up column 0 once and column 2 twice so I think I have an error in the and / or syntax.
For Each varItem In lstPsn.ItemsSelected
This works:
StrsqlWhere = StrsqlWhere & "[tblDiscipline].[discid] = " & lstPsn.Column(0, varItem) & " OR "
This Doesnt:
I would like to add an 'And' to this:
StrsqlWhere = StrsqlWhere & " [tblDiscipline].[discid] = " & lstPsn.Column(0, varItem) & " AND " & _
"tblReview.EvalID = " & lstPsn.Column(2, varItem) & " OR "
Next varItem
msgbox StrSql
Help would be very much appreciated.
Thanks, Dan
For Each varItem In lstPsn.ItemsSelected
This works:
StrsqlWhere = StrsqlWhere & "[tblDiscipline].[discid] = " & lstPsn.Column(0, varItem) & " OR "
This Doesnt:
I would like to add an 'And' to this:
StrsqlWhere = StrsqlWhere & " [tblDiscipline].[discid] = " & lstPsn.Column(0, varItem) & " AND " & _
"tblReview.EvalID = " & lstPsn.Column(2, varItem) & " OR "
Next varItem
msgbox StrSql
Help would be very much appreciated.
Thanks, Dan