Open Report Using Two Combo Box ,, Pleas Help

NimBus87

Registered User.
Local time
Today, 04:00
Joined
Apr 21, 2010
Messages
14
Open Report Using Two Combo Box , VBA Problem,,, Pleas Help

Hi All,

I have to generate a report "List of Names" using 2 combo box 1 would be "province" and 2 would be "City",, ie provide a list of name for those who live in Halifax, Nova Scotia.
I have created this code below and it seems like it does not like the “And”

Thanks, and looking forward to hearing from you

Here is the code I am using in VBA

Private Sub cmdPrv_Click()

Dim strReportName

strReportName = "rptList"

DoCmd.OpenReport strReportName, acViewPreview, , " province = " & "'" & Combo36 & "'" And " City = " & "'" & Combo38 & "'"

End Sub
 
Last edited:
The double quotes on either side of the And need to be removed. The extra concatenations are confusing the issue (the extra sets just for the single quotes).
 
thanks pbaldy,,, it did work :)
 

Users who are viewing this thread

Back
Top Bottom