Microsoft KB Archive/883867

= BUG: A control on a form or on a report that refers to a control on a subform or on a subreport is blank in Access 2003 =

Article ID: 883867

Article Last Modified on 8/29/2006

-

APPLIES TO


 * Microsoft Office Access 2003

-





This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).

Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you open a form that contains a subform, you may notice that the control on the form that refers to the control on the subform is blank. When you open a report that contains a subreport, you may notice that the control on the report that refers to the control on the subreport is blank.

You notice this behavior when the following conditions are true:   The expression in the ControlSource property for the control on the form or on the report does not provide a full reference to the control on the subform or on the subreport, respectively.

For example, to display a value that is calculated in the OrderSubtotal control on the &quot;Orders&quot; subform, the following expression is entered as the ControlSource property for the Subtotal control on the &quot;Orders&quot; main form: =[Orders Subform]!OrderSubtotal  Sandbox mode is turned on for Microsoft Office Access 2003 applications.



RESOLUTION
To resolve this problem, you must install Microsoft Office 2003 Service Pack 1 on your computer.

The following file is available for download from the Microsoft Download Center:

Office 2003 Service Pack 1



WORKAROUND
To work around this problem, you must modify the ControlSource property for the control on the form or on the report. You do this to provide a full reference to the control on the subform or on the subreport, respectively.

To refer to a control on the subform, you must include the .Form identifier in the expression that is entered as the ControlSource property for the corresponding control on the main form.

For example, to display a value that is calculated in the OrderSubtotal control on the &quot;Orders&quot; subform, you must enter the following expression as the ControlSource property for the corresponding control on the &quot;Orders&quot; main form: =[Orders Subform].Form!OrderSubtotal Similarly, to refer to a control on the subreport, you must include the .Report identifier in the expression that is entered as the ControlSource property for the corresponding control on the main report.

For example, to display a value that is calculated in the QuarterTotal control on the &quot;Sales by Year&quot; subreport, you must enter the following expression as the ControlSource property for the corresponding control on the &quot;Sales by Year&quot; main report: =[Sales by Year Subreport].Report!QuarterTotal



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem
Caution If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.  Turn on Sandbox mode for Access 2003 applications. To do this, follow these steps:  Start Access 2003.</li> On the Tools menu, point to Macro, and then click Security.</li> In the Security dialog box, click Medium on the Security Level tab, and then click OK.</li> Close Access 2003.</li></ol>

Note If the macro Security menu item is missing, you must add the menu item by customizing the toolbar.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

833219 Menu items are missing after you upgrade from an earlier version of Microsoft Access to Microsoft Office Access 2003

</li> Start Access 2003.</li> Open the Northwind.mdb sample database.</li> In the Database window, click Forms under the Objects section.</li> In the right pane, right-click Orders, and then click Design View.

The Orders form opens in Design view.</li> On the Orders form, locate, and then select the text box that is named Subtotal.</li> On the View menu, click Properties.</li>  On the Data tab, locate the Control Source property.

Notice that the Control Source property originally contains the following expression: =[Orders Subform].Form!OrderSubtotal On the Data tab, modify the expression in the Control Source property to the following: =[Orders Subform]!OrderSubtotal </li> Save the form.</li> On the View menu, click Form View.

The Orders form opens in Form view.

Notice that the value in the Subtotal box is blank.</li></ol>

<div class="references_section">