Good afternoon, I have a report which filters the data by a between [Start date] and [Last date] in a query. How do I get those two dates to appear on the report so the user knows what data range was selected when the report is printed. Thanks Ron
Passing Information to a Report Often, I see examples where people pass information between Forms and Reports using Opening Arguments "openArgs" ... I did this myself until I happened upon an article, I think it was from "Smart Access" which explained a very satisfying way of Passing information...
www.niftyaccess.com
Reports are generally opened from a Form. The technique I use relies on a generic piece of code in the Report which looks in the Form that opened it and captures the information it requires.
You can keep the Report Record Source in the form, the start date, the end date, the report title, any information of a variable nature can be captured by, and calculated in the Form, then transferred into the report with this method.
Generate Multiple Reports This blog came about because of an answer I gave to a particular OP's question. Therefore the code isn't generic, it is designed for a specific situation, like most examples! However I hope there's enough information here for you to follow what's happening. Multiple...
If these are fields in the report, then you can use them as part of a report title or something that defines the range in a calculated textbox; e.g.
= "Sales From " & [Start date] & "to " & [Last date]
Since the fields are in the query, you can easily add them to the report if they're not already on it - just hide them as they're probably not necessary to the user.
EDIT
If hidden, you can also make them very small so as to not take up space. Also, I would not use separate fields to construct the info line because the values will be different widths at times, thus alignment becomes a problem. If you put the entire line of information in one textbox, it won't matter if you use numbers or words for dates:
Monday, May 2, 2020 will align and fit just as nicely as Thursday, January 25, 2020 but not if you place one date textbox beside another.