Dates in Access Reports

  • Thread starter Thread starter Molly
  • Start date Start date
M

Molly

When I try to print a report containing a subreport that
each come from a parameter query and I want the beginning
dates and ending dates printed on the final report I end
up having to type in the beginning and ending dates 4
times each. All queries and reports have the same
parmeter question for beginning and ending dates. Any
thoughts?
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Change the queries to read a form that has the dates in controls.
E.g.

PARAMETERS Forms!FormName!StartDate DateTime,
Forms!FormName!EndDate DateTime;
SELECT...
FROM...
WHERE TableDate Between Forms!FormName!StartDate
And Forms!FormName!EndDate

The form will have to be open when the report runs so the queries can
"see" the parameters. You can start the report from this form, or,
you can open this form in the Reports OnOpen event procedure (in
acDialog mode - set the form's Visible property to False when the user
is finished entering criteria).

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQBGNtYechKqOuFEgEQKl8gCeP19u6nELAs7Gn50bv+X4QmykBWMAoJWw
0UIIoazIUhk/K07DNVbq2GTc
=wzNQ
-----END PGP SIGNATURE-----
 
When I try to print a report containing a subreport that
each come from a parameter query and I want the beginning
dates and ending dates printed on the final report I end
up having to type in the beginning and ending dates 4
times each. All queries and reports have the same
parmeter question for beginning and ending dates. Any
thoughts?

One way to handle this situation is to create a small unbound Form
(frmCrit let's call it) with textboxes for the parameters you need.
Rather than

=[Enter start date:]

you can use a criterion of

=[Forms]![frmCrit]![txtStartdate]

The same syntax can be used on report textboxes, multiple queries,
etc. as long as the Form is open. It's handy to put a command button
on the form to open the Report.
 
Back
Top