Microsoft KB Archive/265224

= ACC2000: Unbound Controls on a Subform Are Blank When You Print the Main Form =

Article ID: 265224

Article Last Modified on 6/25/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q265224



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

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



SYMPTOMS
When you use code to set a value of an unbound control on a subform, the value is displayed in Form view and in Print Preview. However, when you print the main form, the unbound control on the subform is printed as a blank control, as though it had no value.



RESOLUTION
If the code that sets the value of the unbound control on the subform is relatively simple, you may be able to replace the code with a calculated expression. For example, you could replace rather simple code similar to the following Private Sub Form_Current Dim X As Integer X = Me!Field1 + Me!Field2 + Me!Field3 Me![Unbound Control] = (X / 100) + .5 End Sub with a calculated expression that is written directly within the ControlSource property of the unbound control as follows: = ((Me!Field1 + Me!Field2 + Me!Field3) / 100) + .5 If the code is more complex, however, there may not be an immediate resolution to this problem.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
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.

 Start Microsoft Access 2000, and then open the sample database Northwind.mdb. Open the Product List form in Design view. Add an unbound text box to the detail section of this form, and then set the Name property of the text box to txtUnbound . Close the form, and when you are prompted to save changes, click Yes. Open the Categories form in Design view.</li>  Set the OnCurrent property of the Categories form to the following event procedure: Private Sub Form_Current Forms!Categories![Product List].Form!txtUnbound = _ Forms!Categories!CategoryName End Sub </li> View the form in Form view, and note that the category name on the main form also appears on the subform.</li> Preview the form, and note that the category name still appears on the subform.</li> Print the form, and note that category name no longer appears in the unbound text box.</li></ol>

Additional query words: pra empty contains no information

Keywords: kbbug kbnofix kbprint KB265224

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.