Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing parameter to report

Status
Not open for further replies.

brianjay

Programmer
Sep 14, 2000
42
US
Help. I created a query to request a "from" date and a "To" date. The report is based on those parameters and it works well; BUT how do I put those 2 dates in the header of my report? X-)
 
Put the same parameter in the report. Although I would have the parameters looking at a form, otherwise you will likely have to enter it more than once.

i.e.
Forms!formname!controlname

Make sure the values are committed to the controls (focus should not be in a control) or the query won't see the values... Adding a button to the form to run the report takes care of this problem because when you click the button the controls are committed.
 
If the query is the data source for the form, you just have to enter a bound box that says the exact same phrase as used in the parameter query. The info will flow without the user having to enter it twice. For instance, on some of mine, I put this in a bound text box in the header:

="Between " & [Enter Test Start Date] & " and " & [Enter the test End Date]

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top