How can I Display Parameter Query Values in Report?

J

John

I am using Access 2000.

I have a report based on a parameter query.
In the Criteria Row I have entered: Between [Enter Start Date] and
[Enter End Date]
When the user runs the report, the query asks for the Start and End
Date selection criteria.
On the report I have two text boxes labeled From and Through to hold
the start and end dates for this report.
But. they don't hold the start and end dates for this report.
They hold the minimum and maximum dates of the returned data.

Currently, the From text box holds this code

=min([Date]) and the Through text box holds this code
=max([Date])

How can I have the text boxes display the the dates entered by the user
that are used in the parameter query?

Thanks
John
 
F

fredg

I am using Access 2000.

I have a report based on a parameter query.
In the Criteria Row I have entered: Between [Enter Start Date] and
[Enter End Date]
When the user runs the report, the query asks for the Start and End
Date selection criteria.
On the report I have two text boxes labeled From and Through to hold
the start and end dates for this report.
But. they don't hold the start and end dates for this report.
They hold the minimum and maximum dates of the returned data.

Currently, the From text box holds this code

=min([Date]) and the Through text box holds this code
=max([Date])

How can I have the text boxes display the the dates entered by the user
that are used in the parameter query?

Thanks
John


Add an unbound control to the Report Header. Set it's Control source
to:
= "For Sales between " & [Enter Start Date] & " and " & [Enter End
Date]

The text within the brackets must be identical to the bracketed text
in the query criteria.
 
J

John

Thanks, Fred.
I used the technique in your example and it worked perfectly.

When the user responds to the parameter query by typing in a start date
and end date, they use this format:
3/23/06

Initially, I could not get the text box (unbound control) I was using
to hold the parameter value to display anything other than this short
date format: 3/23/06.

After another search in this forum, I found how to add the custom
formatting I wanted to the value being displayed in the text box.

So, I put the following code in the Control Source for each text box
....

=Format([Enter Start Date],"Long Date")

=Format([Enter End Date],"Long Date")

I could not set the Long Date by using format in the text boxes
property dialog box.

Thanks again for getting me on the right path.
John
 
F

fredg

Thanks, Fred.
I used the technique in your example and it worked perfectly.

When the user responds to the parameter query by typing in a start date
and end date, they use this format:
3/23/06

Initially, I could not get the text box (unbound control) I was using
to hold the parameter value to display anything other than this short
date format: 3/23/06.

After another search in this forum, I found how to add the custom
formatting I wanted to the value being displayed in the text box.

So, I put the following code in the Control Source for each text box
...

=Format([Enter Start Date],"Long Date")

=Format([Enter End Date],"Long Date")

I could not set the Long Date by using format in the text boxes
property dialog box.

Thanks again for getting me on the right path.
John

To show my example of both dates in one control, with both dates as
Long Date:

="For sales between " & Format([Enter Start Date],"Long Date") & " and
" & Format([Enter End Date],"Long Date")
 

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