View Full Version : multiple criteria for report VBA?


pablavo
12-04-2007, 11:39 AM
Hi folks

I borrowed some code to use with reports which is:

If Not IsNull(Me.cboProjectCode) Then
strWhere = strWhere & "[ProjectID]=" & Me.cboProjectCode & " And "
blnTrim = True

Before that I used a technique using a dynamic query by code but this is a lot easier.

My question is. If the field was a text field and not a numeric ID field as above. do you know what the syntax would be? I keep getting type mismatch and so on!

Thanks

pbaldy
12-04-2007, 11:48 AM
Note the added single quotes:

strWhere = strWhere & "[ProjectID]='" & Me.cboProjectCode & "' And "