hi everyone!
Could you help me find where the syntax error? it's like needle in a haystack for me...
Larry
Could you help me find where the syntax error? it's like needle in a haystack for me...
Code:
Dim stDocName As String
Dim varItem As Variant
Dim strWhere As String
For Each varItem In Me![lstEmployee].ItemsSelected
strWhere = strWhere & "EmployeeID = '" _
& Chr(39) & Me![lstEmployee].Column(0, varItem) & Chr(39) & "' Or "
Next varItem
strWhere = Left(strWhere, Len(strWhere) - 4) 'Remove the last " Or "
DoCmd.OpenReport "rptOSR_Template", acViewPreview, , strWhere
Larry