Microsoft KB Archive/212748

From BetaArchive Wiki

Article ID: 212748

Article Last Modified on 7/14/2004



APPLIES TO

  • Microsoft Access 2000 Standard Edition



This article was previously published under Q212748

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

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


SYMPTOMS

A subreport that contains snaking columns does not snake to multiple columns when you preview the main report. The subreport does snake, however, if you preview the subreport as a stand-alone report (instead of within the main report).

CAUSE

This behavior is by design. When you drop one report onto another report, Access creates a subreport control and sets the CanGrow property of the subreport control to Yes (the default for subreport controls).

RESOLUTION

Set the CanGrow property of the subreport control to No and, if necessary, increase the Width property of the main report and the Width property of the subreport control in order to view the snaking columns. For an example of how to do this, follow these steps:

  1. Open the sample database Northwind.mdb.
  2. Create a new report that is based on the Suppliers table in Design view.
  3. View the property sheet for the report, and set the Width property to 3" and the Height property of the detail section to 1".
  4. Drag the SupplierID, CompanyName, and ContactName fields from the field list to the detail section of the report.
  5. On the File menu, click Page Setup. Click the Columns tab, and then set the Number of Columns box to 2.
  6. Under Column Layout, click Down, then Across, and then click OK.
  7. Save the report as SubReport, and then close the report.
  8. Create a new report that is not based on any table or query in Design view.
  9. Drag the SubReport report from the Database window to the detail section of this new report.
  10. Set the following properties of the subreport control:

    CanGrow: No
    Left: 0"
    Top: 0"
    Width: 6"
    Height: 5"

    Save the new report as MainReport, and then preview the report. Note that the subreport displays its data in two columns.

NOTE: By design, once the CanGrow property is set to No, in order for the subreport to display all records, the main report must be bound, and the LinkChild and LinkMaster properties must be set appropriately.

MORE INFORMATION

Columns in a subreport do not snake when both of the following conditions are true:

  • The Column Layout option is set to Down, Then Across in the Page Setup dialog box.
  • The CanGrow subreport control property is set to Yes.

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. Create a new report that is based on the Suppliers table in Design view.
  3. Set the Width property of the report to 3", and set the Height property of the detail section to 1".
  4. Drag the SupplierID, CompanyName, and ContactName fields from the field list to the detail section of the report.
  5. On the File menu, click Page Setup.
  6. Click the Columns tab, and then set the Number of Columns box to 2.
  7. Under Column Layout, click Down, then Across, and then click OK.
  8. Save the report as SubReport, and then preview the report. Note that the report is displayed in two columns.
  9. Close the SubReport report, and then create a new report that is not based on any table or query in Design view.
  10. Drag the SubReport report from the Database window to the detail section of the new report.
  11. Set the following properties for the subreport control:

    Left: 0"
    Top: 0"
    Width: 6"
    Height: 5"

  12. Save the new report as MainReport, and then preview the report.

Note that the subreport is displayed as one column in the main report instead of two, and that you must move to other pages to view the remaining records.


Additional query words: prb

Keywords: kbprb KB212748