Multiple filters in reports using VBA

Ajit Singh

Registered User.
Local time
Today, 12:56
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 & "'")
 
Try.

DoCmd.OpenReport "MatrixBy_Member", acViewPreview, , "full_name = '" & Me.Combo5 & "' And frequency_description = '" & Me.Combo7 & "'"
 
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
 
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

Back
Top Bottom