Report previews OK but prints #error

  • Thread starter Thread starter Damien McBain
  • Start date Start date
D

Damien McBain

This (Access) report runs from a link on the main menu in preview mode and
displays perfectly.
When the user either prints, exports to excel, word or as a snapshot there's
#error where the numbers should be.
Any ideas?

Damo
 
Did you close the form?
Does the error still occur if you leave it open?
Reading a value from a form that is now closed would cause an error.

Alternatively, does the report's module contain code?
Do you need to reset a variable in the Report_Header's Format event?
 
Allen said:
Did you close the form?
Does the error still occur if you leave it open?
Reading a value from a form that is now closed would cause an error.

Alternatively, does the report's module contain code?
Do you need to reset a variable in the Report_Header's Format event?

The form contains 2 fields (from date and to date) on which the query
underlying the report is filtered. The form closes immediately after the
report opens.
I guess if Access requeries when the user exports or prints then the
variables no longer exist.
I think you've pointed me in the right direction Allen, thanks for replying.

cheers

Damien
 
The form contains 2 fields (from date and to date) on which the query
underlying the report is filtered. The form closes immediately after the
report opens.

Suggestion: set the Visible property of the form to False in the code
which opens the report. Close the Form in the Report's Close event
(after you're done with it).

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
John said:
Suggestion: set the Visible property of the form to False in the code
which opens the report. Close the Form in the Report's Close event
(after you're done with it).

Thanks John, yes, I'll be heading in that direction.

Damien
 

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

Back
Top