Displaying Parameter Values In Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've bulit a report based on a parameter query where Between [From Date] And
[To Date] is used. How can I make these dates display on my report?

Thanks / Bell
 
Bell,

If you are collecting the from and to dates by means of input boxes at
rubntime (criteria like [Enter start date] etc), then you need to
include those criteria in the query parameters; while in query design
view, go Query > Parameters in the menu, add the exact same expressions
as they appear in the criterion, e.g. [Enter start date] and [Enter end
date] and select the date/type value next to them; save the query.
Unless there is a typing mistake, you should only be asked once for each
again. Now, in your report design, you can use =[Enter start date] as a
textbox's control source.

If, on the other hand, the query is picking up the dates from a form
(which is how I prefer to do it, it looks much more professional), like:
= Forms!MyForm!StartDate And <= Forms!MyForm!EndDate
then you can use the same references in the the report textbox's control
source, i.e. =Forms!MyForm!StartDate etc.
I strongly suggest you explore this route, as it bears additional
merits, like:
* you can add a command button on the same form, to open the report;
this gives an even more prof. look to your app
* you can add some simple code behind the button, to validate the
entered dates (From <= To)
* you can use Calendar controls instead of having the user type in dates
etc.

HTH,
Nikos
 
I've bulit a report based on a parameter query where Between [From
Date] And [To Date] is used. How can I make these dates display on my
report?

Thanks / Bell

To display the parameters on a report set a textbox Control Source to the
Parameter name for example [To Date]


- Jose
 
Bell,
You can create a text box in your report say in the report header saying
something like(if you are using a form to pass parameters)

="For the period of " & Forms![myForm]!txtStartDte & " to " &
Forms![myForm]!txtEndDte

where txtstartDte and txtEndDte are the text fields in the form which accept
start date and end date.
If you are passing values to the parameters directly, you can use the same
logic also.
 
Thank you, it worked, I will look closer into working with forms instead.

/ Bell

"Bell" skrev:
 
I will look closer into working with forms instead.

Wise decision. You'll find it's a one way street, do it once and you'll
never go back.

Nikos
 
What if I'm not using a Form to do that?

neeraj said:
Bell,
You can create a text box in your report say in the report header saying
something like(if you are using a form to pass parameters)

="For the period of " & Forms![myForm]!txtStartDte & " to " &
Forms![myForm]!txtEndDte

where txtstartDte and txtEndDte are the text fields in the form which accept
start date and end date.
If you are passing values to the parameters directly, you can use the same
logic also.

Bell said:
I've bulit a report based on a parameter query where Between [From Date] And
[To Date] is used. How can I make these dates display on my report?

Thanks / Bell
 
Consider moving toward using a form and controls. This creates a much better
solution than parameters. If you want to stay with parameter prompts, try:

="For the period of " & [Enter Start Date] & " to " & [Enter End Date]

--
Duane Hookom
MS Access MVP
--

jeannette_rivera said:
What if I'm not using a Form to do that?

neeraj said:
Bell,
You can create a text box in your report say in the report header saying
something like(if you are using a form to pass parameters)

="For the period of " & Forms![myForm]!txtStartDte & " to " &
Forms![myForm]!txtEndDte

where txtstartDte and txtEndDte are the text fields in the form which
accept
start date and end date.
If you are passing values to the parameters directly, you can use the
same
logic also.

Bell said:
I've bulit a report based on a parameter query where Between [From
Date] And
[To Date] is used. How can I make these dates display on my report?

Thanks / Bell
 
Back
Top