Date range has to be used several times on one report

  • Thread starter Thread starter Wolf
  • Start date Start date
W

Wolf

This is due to multiple charts being present on the report page. For
instance there are 6 charts all of which require a date range. This is very
tedious at best and I am wondering if there is a way for me to only have to
type the date range once and still return 6 different charts within the date
range. All charts can get data from the same query even though each chart
represents a different piece of equipment.
 
Give up on ever using parameter prompts in queries. Consider replacing them
with references to values of controls on a form. This provides much greater
functionality.
 
Create an unbound form, with text boxes where you enter the limiting dates.

In the Criteria row of your query, under the date field, enter:
Between [Forms].[Form1].[StartDate] And [Forms].[Form1].[EndDate]
Access should then read the values from the form 6 times instead of popping
up the parameter dialogs 6 times.

To get this working reliably:
1. Set the Format property of the unbound text boxes to Short Date or
similar, so Access knows they are dates.

2. Declare the parameters in the query, so Access treats them as dates.
Choose Parameters on the Query menu (in query design.)
Enter 2 rows into the little dialog:
[Forms].[Form1].[StartDate] Date/Time
[Forms].[Form1].[EndDate] Date/Time
 
Thank you I will try this

Allen Browne said:
Create an unbound form, with text boxes where you enter the limiting
dates.

In the Criteria row of your query, under the date field, enter:
Between [Forms].[Form1].[StartDate] And [Forms].[Form1].[EndDate]
Access should then read the values from the form 6 times instead of
popping up the parameter dialogs 6 times.

To get this working reliably:
1. Set the Format property of the unbound text boxes to Short Date or
similar, so Access knows they are dates.

2. Declare the parameters in the query, so Access treats them as dates.
Choose Parameters on the Query menu (in query design.)
Enter 2 rows into the little dialog:
[Forms].[Form1].[StartDate] Date/Time
[Forms].[Form1].[EndDate] Date/Time

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Wolf said:
This is due to multiple charts being present on the report page. For
instance there are 6 charts all of which require a date range. This is
very tedious at best and I am wondering if there is a way for me to only
have to type the date range once and still return 6 different charts
within the date range. All charts can get data from the same query even
though each chart represents a different piece of equipment.
 
Back
Top