Error when opening Access Report (1 Viewer)

JefJFitz

New member
Local time
Today, 13:40
Joined
Apr 29, 2024
Messages
7
I have a report that displays either #REF or #NAME for some of the fields (but not all) when I open it up in print preview. If I switch to design view and then back to print preview it corrects the error and everything displays correctly. Odd thing is that until yesterday, everything was working perfectly. Not sure how to fix. Any suggestions would be greatly appreciated. Thank you!
 

tvanstiphout

Active member
Local time
Today, 10:40
Joined
Jan 22, 2016
Messages
289
Is there any macro or vba code in that report?
Do you have code anywhere that may change the query used as the RecordSource for this report?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:40
Joined
Feb 28, 2001
Messages
27,517
OK, #NAME is easy. Whatever would have been in that slot was being called out by name, and you got the name wrong. #REF is harder but generally means that you perhaps passed an object by reference and got the name of the object wrong.

Note that NEITHER of those explanations is exclusive.

What you need to do to fix this is to look at the places where those errors occur. Go back in design mode and examine the data sources for those particular elements to verify spelling and/or existence.

Another question is, if there is any code involved such as defining the object via some VBA code that loads a formula, it is possible that the formula contains a bad reference or bad name. However, this might be due to not having Option Explicit at the top of every module including both general and form/report class modules. If you have Option Explicit, you CAN'T get away with referencing an unknown object in code.
 

GaP42

Active member
Local time
Tomorrow, 03:40
Joined
Apr 27, 2020
Messages
418
Sounds like a similar problem:
 

Users who are viewing this thread

Top Bottom