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!

How Do I Feed Query Prompts into a Report?

Status
Not open for further replies.

Kellly

MIS
Jul 7, 2000
3
US
I have a query that prompts the user to enter the Start Date and the End date on an Issue Date.&nbsp;&nbsp;When the query runs, it only gives you the information between the 2 dates.<br><br>I then created a report off the query that again, prompts for the dates.&nbsp;&nbsp;However, there is no way to tell on the report what the dates are for.&nbsp;&nbsp;I would like to have a line either in the title or in the footer that says &quot;Between ______ (Start date) and _____________ (End date)&quot;.&nbsp;&nbsp;That way whenever the report is printed, it will show what the start date and end dates are.<br><br>Any help would be greatly appreciated.
 
In the Report add a textfield and in this textfield type in the following as the control source.<br><br>= &quot;Between &quot; & [name of field with start date] & &quot; and &quot; & [name of field with end date]<br><br>Make sure you add spaces inside of the quotes for the information that is not in the quotes. <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
You can use an OpenReport statement where you supply the start and end dates, and&nbsp;&nbsp;use a query that doesn't use date criteria at all.&nbsp;&nbsp;Just create a form that has two textboxes to enter the dates and a command button to open the report<br><br>if you know the dates, you can hardcode an OpenReport command such as:<br><br>DoCmd.OpenReport &quot;NameOfReport&quot;, acPreview, &quot;&quot;, &quot;[IssueDate] Between #1/1/1990# And #5/31/1999#&quot;<br><br>if you enter&nbsp;&nbsp;the dates into textboxes on a form that will remain open when you open the report , you can code an OpenReport command such as:<br><br>DoCmd.OpenReport &quot;NameOfReport&quot;, acPreview, &quot;&quot;, &quot;[IssueDate] Between #&quot; & forms!frmName!txtStartDate & &quot;# And #&quot; & forms!frmName!txtEndDate & &quot;#&quot;<br>or<br><br>DoCmd.OpenReport &quot;NameOfReport&quot;, acPreview, &quot;&quot;, &quot;[IssueDate] Between #&quot; & txtStartDate & &quot;# And #&quot; & txtEndDate & &quot;#&quot;<br><br>if you enter&nbsp;&nbsp;the dates into textboxes on a form that will be closed when you open the report , you can store the values to Public Variables (in the AfterUpdate() event of the textboxes) then you can code an OpenReport command such as:<br><br>DoCmd.OpenReport &quot;NameOfReport&quot;, acPreview, &quot;&quot;, &quot;[IssueDate] Between #&quot; & dtStartDate & &quot;# And #&quot; & dtEndDate & &quot;#&quot;<br><br>PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top