Report previews OK but prints #error

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
 
A

Allen Browne

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?
 
D

Damien McBain

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
 
J

John Vinson

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
 
D

Damien McBain

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
 
Top