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!

Information input on form to be shown on report

Status
Not open for further replies.

Mandyxoxo

Programmer
Jul 15, 2008
11
US
I have a dialog form that pops up to retrieve dates for a report. The form works and then takes the dates and generates the query based off of those dates just fine. However, the query only outputs a single Total and therefore the dates are in a subquery. I want the report to say on it which dates it is for. Since the form is grabbing the dates and the query is only outputting a Total and not a date, how would I get the report to reflect the dates chosen on the form.

Thank you in advance!
 
put 2 text boxes on your report header named

startdate
enddate

and in the for open
Code:
me.startdate = forms!formname!startcontrolname
me.enddate = forms!formname!endcontrolname
change fromname to the name of your form
 
On the report, put a text box with something like
Code:
="Dates from " & [Forms]![FormName]![txtStartDate] & " to " & [Forms]![FormName]![txtEndDate]


where txtStartDate and txtEndDate are the names of your text boxes on your form ("FormName").

So this will end up saying

Dates from 1/1/08 to 3/31/08.


actually they'll probably say "2008" unless you put FORMAT() around them.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top