We help IT Professionals succeed at work.
Get Started

Passing Parameters to Report

Evan Cutler
Evan Cutler asked
Last Modified: 2012-08-15
Greetings EE Warriors...
I have this command, that uses a Args string to populate the arguements side of the DoCMD.OpenReport command.

The fields are identical to the report, but the report keeps asking for the fields, as if it doesn't recognize the arguement values.  I know they work because when I do a MSGBox of Args it shows:  "[StartDate] = #2/1/2011# and [EndDate] = #2/28/2011# and [CompareStartDate] = #2/1/2010# and [CompareEndDate] = #2/28/2010#"  Which is correct, and the fields are identical in spelling and case to the reports expected fields.

    Args = "[StartDate] = #" & StartDateEntry & "# and [EndDate] = #" & EndDateEntry & "# and [CompareStartDate] = #" & CmprStartDate & "# and [CompareEndDate] = #" & CmprEndDate & "#"
        DoCmd.OpenReport "rLODDths", acViewPreview, , , acWindowNormal, Args

Help?  The report does not respect the arguments.  What do I do?

Start Date
Watch Question
Most Valuable Expert 2012
Top Expert 2013
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE