print a date range from parameter query on a report header?

S

siyeducation

I am printing a report based on a date range. The user inputs the start and
End date for the report (parameter query). How do I print the Start and End
dates on a report header.
 
D

Duane Hookom

IMO, parameter prompts are never good user interface. There is no
functionality or error checking. I much prefer using controls on forms for
ALL user interaction.

You can use the parameters in control sources as if they were fields. For
instance:
Control Source: ="From " & [Enter Start Date] & " To " & [Enter End Date]
or
Control Source: ="From " & Forms!frmRpt!txtStartDate & " To " &
Forms!frmRpt!txtEndDate
 
A

Armen Stein

IMO, parameter prompts are never good user interface. There is no
functionality or error checking. I much prefer using controls on forms for
ALL user interaction.

You can use the parameters in control sources as if they were fields. For
instance:
Control Source: ="From " & [Enter Start Date] & " To " & [Enter End Date]
or
Control Source: ="From " & Forms!frmRpt!txtStartDate & " To " &
Forms!frmRpt!txtEndDate

I agree, forms are the way to go.

One way to have a report prompt the user for criteria before it runs
is to open a form from the report's Open event. Open the form in
Dialog mode so that the report waits for the form to be closed or
hidden before it proceeds. That way you can collect criteria from the
user and build a Where clause for the report. It also means that you
can call the report directly - you don't need to call it from a form.
And the selection form is reusable - it can be called from multiple
reports if they need the same criteria.

I've posted examples of this technique on our free J Street Downloads
page at http://ow.ly/M58Y
See "Report Selection Techniques".

Also, if you want to include printing the selection criteria in
English on the report, this example shows that also.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top