Printing Date Range on Reports

J

Jaxamercy

I have a report that is generated by the user entering a date range into a
form, presses an apply button which run a macro awhcih runs all the queries
etc. The reports generates fine however I want to add the date range the user
selected to the report. I have done this in two seperate text boxes, the
first labled " Start Date" the second "End Date.

I have set the control for the Start Date Text Box as =Forms!frmDate!
startdate and for the End Date =Forms!frmDate!enddate.

I bleive this should work but when the report is generated all that is
returned is a #NAME? error.

I ahve checked that the name of the form and the fields in the form are
correct.

Any help greatly appreciated.

Cheer

Jax
 
A

Allen Browne

Suggestions:

1. Make sure the form stays open in the backgroud while the report is open.
The report can't read from the form if the form closes.

2. Check the Name property of these text boxes on the report. The Name must
not be the same as the name of any fields in the report. You can set to name
to Text99 or something.

3. If it still fails, copy the Control Source text to clipboard (so you have
it exactly) in report design view. Open the Report. Now press Ctrl+G to open
the Immediate Window. Paste the expression in, and replace the "=" with "?",
so the line reads:
? Forms!frmDate!startdate
When you press Enter on this line, does it print the date?
- No: the expression is wrong, or the form is not open.
- Yes: the expression is right, so something else is wrong in the report.

It is just possible that the problem is with another calculated control on
the report: once Access is unable to calculate one, it gives up on the
others.
 
D

Duane Hookom

Make sure the name of the text box is not also the name of a field.
Is the form open?
 
J

Jaxamercy

Thanks both for your speedy responses it was infact an error in another
calculation.

Thanks for your help.
 

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