ACC2000: "#ERROR" Message When Referencing Subreport ControlsID: Q208718
|
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
If you reference a subreport control from a main report when the subreport
does not return any matching records, you may receive the following message
for the referenced subreport control.#ERROR
When the subreport has no data, it is not available. Referencing an empty subreport results in an invalid operation.
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.
Query: Sorter
-------------------
Type: Select Query
Field: CompanyName
Criteria: Like "P*"
Field: CustomerID
Save the query as Sorter. Note that this query limits the recordset only to customer records beginning with the letter "P" and includes a customer with no orders.
ControlSource: =Sum([Freight])
ControlName: TotFreight
The subreport prints the detailed freight items with a grand total for all freight charges.
=([SubRpt].[Report]![TotFreight])
in step 9 above with the following line:
=IIF([SubRpt].Report.HasData=True, [SubRpt].Report![TotFreight], 0)
For more information about the HasData property, click Microsoft Access Help on the
Help menu, type "HasData property" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words: pound error prb
Keywords : kberrmsg kbdta RptSub
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 28, 1999