Copy Date Range From a Query to a Report

G

Guest

I have a query that gets records within a date range from a table. When the
query runs it asks "Enter Start Date" and Enter End Date". I would like the
date range to show up in the report header that is generated from the query.
How can I do this?
 
A

Allen Browne

The two parameters become part of the query, and are available in the
report.

Add 2 text boxes to the report, and set their control sources to the
parameter names, i.e.:
=[Enter Start Date]
and
=[Enter End Date]
with the Format property of both boxes set to Short Date or similar.
 
G

Guest

Thanks for the quick response. This works except that when I run the report
it asks me to enter the date range twice now. I should say that the query
only has one date field whose criteria looks like this: >=[ENTER START
Date:] And <=[END Date:]
I took your suggestion and created one text box in the header of the report
and now when I run the report it asks for a start date and an end date and
then asks for a start and an end date again.
Any suggestions?

Allen Browne said:
The two parameters become part of the query, and are available in the
report.

Add 2 text boxes to the report, and set their control sources to the
parameter names, i.e.:
=[Enter Start Date]
and
=[Enter End Date]
with the Format property of both boxes set to Short Date or similar.

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

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

thefeokas said:
I have a query that gets records within a date range from a table. When
the
query runs it asks "Enter Start Date" and Enter End Date". I would like
the
date range to show up in the report header that is generated from the
query.
How can I do this?
 
V

Van T. Dinh

Allen advisd to use *two* textboxes with separate ControlSources. You wrote
that you used *one* TextBox???

What do you use for the ControlSource of the single TextBox?
 
A

Allen Browne

Also, your original example in the query did not have the colons.
The spelling of the names must be identical for Access to recognise you are
referring to the same parameter.

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

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

Van T. Dinh said:
Allen advisd to use *two* textboxes with separate ControlSources. You
wrote
that you used *one* TextBox???

What do you use for the ControlSource of the single TextBox?


thefeokas said:
Thanks for the quick response. This works except that when I run the report
it asks me to enter the date range twice now. I should say that the
query
only has one date field whose criteria looks like this: >=[ENTER START
Date:] And <=[END Date:]
I took your suggestion and created one text box in the header of the report
and now when I run the report it asks for a start date and an end date
and
then asks for a start and an end date again.
Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top