Multiple filters in reports using VBA (1 Viewer)

Ajit Singh

Registered User.
Local time
Today, 11:24
Joined
Jul 11, 2013
Messages
34
Using one form with multiple combo boxes on the basis of which am trying to generate a report. Below is the code I've put in a command button (in Form) by which I want to generate a report....FYI - both combo boxes have text value....Please help.


DoCmd.OpenReport "MatrixBy_Member", acViewPreview, , ("full_name = '" & Me.Combo5 & "'") And ("frequency_description = '" & Me.Combo7 & "'")
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 11:24
Joined
Aug 30, 2003
Messages
36,130
Try.

DoCmd.OpenReport "MatrixBy_Member", acViewPreview, , "full_name = '" & Me.Combo5 & "' And frequency_description = '" & Me.Combo7 & "'"
 

Ajit Singh

Registered User.
Local time
Today, 11:24
Joined
Jul 11, 2013
Messages
34
thank you....it worked as I required.......but have one more requirement in addition to this....need one more criteria to get the report and this time it is a number field (Combo 22). using below code but encountering an error. Please help

DoCmd.OpenReport "MatrixBy_Member", acViewPreview, , "full_name = '" & Me.Combo5 & "' And frequency_description = '" & Me.Combo7 & "'" And "days_past_cdate = '" & Me.Combo22
 

pr2-eugin

Super Moderator
Local time
Today, 19:24
Joined
Nov 30, 2011
Messages
8,494
If it is a Number you do not need to enclose them in single quotes..
Code:
DoCmd.OpenReport "MatrixBy_Member", acViewPreview, , "full_name = '" & Me.Combo5 & "' And frequency_description = '" & Me.Combo7 & "' And days_past_cdate = " & Me.Combo22
 

Users who are viewing this thread

Top Bottom