multiple criteria for report VBA?

pablavo

Registered User.
Local time
Yesterday, 17:29
Joined
Jun 28, 2007
Messages
189
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
 
Note the added single quotes:

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

Users who are viewing this thread

Back
Top Bottom