ACC2000: Detail Section Blank When Form Is Printed or Previewed (209028)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q209028
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 print or preview a form, the detail section of the form is blank, even though controls are visible in the detail section when you view the form in Form view. Other sections, such as the form header and form footer, appear correctly when you print or preview the form.

CAUSE

This behavior occurs if the form's underlying table or query returns no records, or if the DisplayWhen property of the detail section is set to Screen Only.

RESOLUTION

To resolve this behavior, use one of the following methods.

Method 1

Make sure that the underlying table or query returns at least one record.

Method 2

Use a report instead of a form. To create a report that looks like a form, follow these steps:
  1. Open the form in Form View.
  2. On the File menu, click Save As.
  3. In the Save Form '<name>' To box, type the name of the report. In the As box, click Report, and then click OK.
  4. Open report that you saved in step 3 to make sure that it looks like you want it to. You can now print the report.

Method 3

Place the controls that you need in other sections, for example, in the form header or in the form footer.

Method 4

If the DisplayWhen property of the detail section is set to Screen Only, change it to Always or to Print Only.

MORE INFORMATION

Steps to Reproduce Behavior

Example 1: No Records in Underlying Table

  1. Open the sample database Northwind.mdb.
  2. Create a new table with several fields. Do not add any records to the table.
  3. Save the new table as Table1, and then close it.
  4. Create a new form based on the Table1 table. Place the fields from the table in the detail section of the form.
  5. Place some controls, such as labels or buttons, in the form header and form footer.
  6. View the form in Form view. Note that you can see all the controls.
  7. Print or preview the form. Note that the detail section is blank.

Example 2: DisplayWhen Property Set to Screen Only

  1. Open the sample database Northwind.mdb.
  2. Preview the Categories form. Note that you can see the controls in the detail section of the form.
  3. Open the Categories form in Design view.
  4. Change the DisplayWhen property of the detail section to Screen Only.
  5. Preview the form again. Note that the detail section is blank.

REFERENCES

For more information about the DisplayWhen property, click Microsoft Access Help on the Help menu, type DisplayWhen property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:12/12/2002
Keywords:kbdta kbprb kbprint kbusage KB209028