Type Mismatch Error . .

Evagrius

Registered User.
Local time
Today, 02:39
Joined
Jul 10, 2010
Messages
170
Hi,

I am trying to use TWO multiselect listboxes to filter a report before opening. I get a Typemismatch error at this line.


Code:
Rem OPEN THE REPORT LIMITED TO SELECTION
  DoCmd.OpenReport "UNIQUE REPORT", acViewReport, , "[Year] IN(" & strWhere & ")" And _
"[Building] IN(" & strWhereB & ")"

What am I doing worng? strWhereA and strWhereB store the selections in a string. Thank you!
 
The AND has to be within the quotes:
Code:
  DoCmd.OpenReport "UNIQUE REPORT", acViewReport, , "[Year] IN(" & strWhere & ") [B][COLOR="Red"]AND "[/COLOR][/B]  & _
"[Building] IN(" & strWhereB & ")"
 
That is perfect Bob! Thank you Sir!!
 

Users who are viewing this thread

Back
Top Bottom