Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing dates to a query for use in a chart

Michael DeLawter
Guest
 
Posts: n/a
#1: Nov 12 '05
Using Access 2002.

I have a chart in a report that is currently based on a query in which
the user enters the start and end date for the chart to display. Both
the start and end dates have been identified as parameters so that the
date range can be found without causing an error. So far so good,
report works as it should.

Here's the problem. There are several reports that need to be printed
at the end of month that use the same date ranges. Is there any way
to have the query pick up its start and end dates from a form instead
of entering it for each report? I have tried experimenting with this,
but have a problem with the parameter values. If I completely remove
the parameter values, I get the typical OLE error. If I attempt to
modify the parameters to match the Forms!.... information, I get a
bracketing error. Has anyone been able to get through this and if so,
what did you do?

Thanks for any help you can provide,

Mike.

Dennys G.
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Passing dates to a query for use in a chart


Yes, have you tried a "query by form?" Create an unbound form with two
unbound date-datatype text boxes. Make a separate query for each of your
reports and in the criteria row of the date column of the queries, add this:
"Is Not Null And Between [Forms]![your new form's name]![name of BEGINNING
date unbound text box on form] And [Forms]![your new form's name]![name of
ENDING date unbound text box on form]." (Without the quotes!) Be sure each
of your reports has the applicable parameter query as its record source.
Add a button for each report on the unbound form. Now, you can print all of
your reports from the new form without reentering the dates.

Denny G.


"Michael DeLawter" <mister_d77@hotmail.com> wrote in message
news:40e96c46.0309030729.e5805c1@posting.google.co m...[color=blue]
> Using Access 2002.
>
> I have a chart in a report that is currently based on a query in which
> the user enters the start and end date for the chart to display. Both
> the start and end dates have been identified as parameters so that the
> date range can be found without causing an error. So far so good,
> report works as it should.
>
> Here's the problem. There are several reports that need to be printed
> at the end of month that use the same date ranges. Is there any way
> to have the query pick up its start and end dates from a form instead
> of entering it for each report? I have tried experimenting with this,
> but have a problem with the parameter values. If I completely remove
> the parameter values, I get the typical OLE error. If I attempt to
> modify the parameters to match the Forms!.... information, I get a
> bracketing error. Has anyone been able to get through this and if so,
> what did you do?
>
> Thanks for any help you can provide,
>
> Mike.[/color]


Closed Thread