Microsoft KB Archive/114510

= ACC: Limitations on Setting Report Properties at Run Time =

Article ID: 114510

Article Last Modified on 5/6/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q114510



Novice: Requires knowledge of the user interface on single-user computers.



SUMMARY
Microsoft Access versions 1.x and 2.0 support using macros or code to set certain properties at run time for reports.



MORE INFORMATION
To prevent possible problems during formatting and printing, the following limitations have been imposed for setting properties at run time for reports:


 * The following properties can only be set from the OnOpen property (not from OnFormat, OnPrint, or OnRetreat):
 * "Datasource" properties: RecordSource, ControlSource, LinkChildFields, and LinkMasterFields.
 * The RecordSource property of a SubReport/SubForm embedded in a report can only be set from the OnOpen of the SubReport/SubForm. This property is Read Only from the OnOpen of the Main Report.
 * Any action in any property that would cause the report width to grow. This includes moving a control past the current report width. This is restricted because you could inadvertently increment the number of pages in the middle of a print job.
 * The following properties cannot be set at run time at all:
 * The SourceObject property for subforms and subreports.
 * "Event" properties: OnOpen, OnFormat, OnPrint, and so on.
 * RunningSum
 * HideDuplicates
 * CanGrow and CanShrink
 * KeepTogether
 * ForceNewPage
 * RowSource for Graph objects
 * Height property of the section
 * The following properties can be set from the OnFormat property, but not the OnPrint property:
 * The Height property of a control
 * The Width property of a control

All other properties can be set at run time (in a report's OnOpen, OnFormat, or OnPrint property, for example).

NOTE: All the restrictions in this article also apply to form printing.

