Solved Show dates on report filtered in query (1 Viewer)

rondon

Member
Local time
Tomorrow, 01:11
Joined
May 16, 2020
Messages
53
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:11
Joined
Oct 29, 2018
Messages
21,456
Hi Ron. You could try using the same parameters on your report, for example:

=[StartDate]

or, use a Form to ask for the dates.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:11
Joined
May 7, 2009
Messages
19,233
the parameter has space on it.

add two unbound textbox on your report (txtStart, txtEnd).
on their Control Source property, type:

=[Start date]
=[Last date]

respectively.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 16:11
Joined
Jul 9, 2003
Messages
16,271
I answered a similar question on AWF recently:-



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.

In this BLOG:-


I show the process in greater detail.
 
Last edited:

Micron

AWF VIP
Local time
Today, 11:11
Joined
Oct 20, 2018
Messages
3,478
[Start date] and [Last date] in a query
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.
 
Last edited:

rondon

Member
Local time
Tomorrow, 01:11
Joined
May 16, 2020
Messages
53
Thank you all for your thoughts they all have given me options Thanks Ron
 

Users who are viewing this thread

Top Bottom