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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show data prompted for by query in a report?

Status
Not open for further replies.

addy

Technical User
May 18, 2001
743
GB
I have a report based on a query which prompts the user for an input. The report needs to be generated for any particular time period so my query has a date field and the criteria is set to:

Between [Start Date] And [End Date], so that when the user runs the report, they are asked to input two dates. Can I display these date inputs on my report? Ideally, I would like my report to have a title something like "For Period..... to .......", where the ....'s show the dates the user specified.

Any help would be appreciated.

Thanks.
 

Yes, you can put criteria in onnce:

1. Creat a form in design mode, and give it a name for example: fmDLG.
2. Add two unbound text box.
3. Rename first text box (for example) bdate, and the other edate.
4. Add botton to open the report from wizard.
5. Go to the quiry which include the data, under the date field and write: =between [Forms]![fmDLG]![bdate] and [Forms]![fmDLG]![edate] .
6. When you want to generate the report, open it from the form fmDLG.

Thanks,
mtomar@msn.com
 
You can also do this:

1. Add an unbound text box in your report header.
2. Repeat the user prompt in the control source:
= [Enter Start Date] & " To " & [Enter End Date]

Note: You will only be prompted once for the dates.
 
oops

In your case it would be
= [Start Date] & " To " & [End Date]

The prompts have to match exactly, otherwise you will be prompted twice ;-)
 
sko

That was exactly what I was after - thanks mate.

:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top