ACC: "#ERROR" Message When Referencing Subreport Controls 95/97 (138906)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q138906
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
If you reference a subreport control from a main report when the subreport
does not return any matching records, you may receive a "#ERROR" message
for the referenced subreport control.
NOTE: This article explains a technique demonstrated in the sample
files, RptSampl.exe (for Microsoft Access for Windows 95 version 7.0)
and RptSmp97.exe (for Microsoft Access 97). For information about how
to obtain these sample files, please see the following articles in the
Microsoft Knowledge Base:
145777 ACC95: Microsoft Access Sample Reports Available in Download Center
175072 ACC97: Microsoft Access 97 Sample Reports Available in Download Center
CAUSE
When the subreport has no data, it is not available. Referencing an empty
subreport results in an invalid operation.
RESOLUTION
Make sure that subreport fields referenced in a main report contain data by
adding a function to test for this condition. See the "Steps to Reproduce
Behavior" and "Steps to Work Around Behavior" sections later in this
article for an example of such a function.
STATUS
This behavior is by design.
REFERENCES
For more information about the HasData property, search the Help Index for
"HasData Property," or ask the Microsoft Access 97 Office Assistant.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kberrmsg kbprb KB138906 |
---|
|