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
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: