Troubleshoot reports

Microsoft Office Access 2003

ShowPrinting and previewing

ShowMy report prints a blank page at the end of a printed report.

Make sure the Height property is set to zero for the report footer.

ShowEvery other page in my report is blank.

Make sure that the total width of the form or report plus the widths of the left and right margins don't exceed the paper size specified in the Page Setup dialog box (File menu). You can use the following formula as a guide:

report width + left margin + right margin <= paper size

You can adjust the size of the report in one or both of the following ways:

  • Reduce the width of the report.

  • Reduce the margins or change the page orientation.

ShowThere is too much blank space in my report.

You can reduce the blank space by doing one of the following:

  • Reduce the width of the report.

  • Move controls closer together.

  • Reduce the size of a control to fit its contents.

ShowLayout Preview displays the wrong data.

Layout Preview displays all the sections of a report and a few detail records. It sorts and groups the data it displays, but ignores any parameters, criteria, or joins in the underlying query. For example, the detail records you see in a group may not be the records that actually belong in that group.

To verify the accuracy of the data in a report, use Print Preview.

ShowMy report prompts me for unexpected parameters.

Make sure that all field names used in the following areas of the report's design are spelled correctly and match field names in the underlying table or query:

  • ControlSource property of any bound controls

  • Field/Expression column in the Sorting And Grouping box

  • Expressions in controls or in the Sorting And Grouping box

Also, make sure that any aggregate functions reference field names in the underlying table or query, not control names.

ShowWorking with subreports

ShowThe column headings in my subreport don't print.

Microsoft Access doesn't print the page header and footer in a subreport, so if you put the labels for the column headings in the subreport's page header, they won't show up when you print the report.

  • If a subreport will always fit on one printed page, you can put the labels for the column headings in the subreport's report header.

  • If a subreport might span several printed pages, put the labels for the column headings in the subreport's group header, and set the RepeatSection property of the group header to Yes.

ShowThe data in my report and subreport is not synchronized. All records show up in the subreport.

Link your main report and subreport using the LinkChildFields and LinkMasterFields properties.

ShowHow?

  1. Open the main report in Design view.

  2. Make sure the subreport control is selected, and then click Properties Button image on the toolbar to display the property sheet for the subreport control.

  3. Set the linking fields. To enter more than one linking field or control, separate the field or control names with a semicolon. If you enter more than one field or control, you must enter the names in the same order in the LinkChildFields and LinkMasterFields properties.

    • In the LinkChildFields property box, enter the names of the linking fields in the subreport.

    • In the LinkMasterFields property box, enter the names of the linking fields or controls in the main report.

    Note  You can't use the name of a control in the LinkChildFields property box. The LinkMasterFields property can be set to the name of either a field or a control.

  4. If you're unsure what the linking fields should be, click the Build button Button image next to either property box to open the Subform/Subreport Field Linker.

If you've already set the LinkChildFields and LinkMasterFields properties and the subreport still doesn't work, make sure that:

  • You aren't using fields that have been renamed or deleted.

  • You've spelled the field names correctly.

  • You're using the actual field names, not the control names specified in the Name property.

Notes

  • The linking fields don't have to appear in the main report or the subreport, but they must be included in the underlying record source. If you use the Report Wizard to create the subreport, Microsoft Access automatically includes the linking fields in the underlying record source even if you don't select them in the wizard.

  • The linking fields must contain the same kind of data and have the same or a compatible data type or field size. For example, an AutoNumber field is compatible with a Number field whose FieldSize property is set to Long Integer.

ShowMy subreport prints only one column when it should print more.

A subreport might print only one column if:

  • In the subreport, the Column Layout property is set to Down, Then Across on the Columns tab in the Page Setup dialog box, and

  • In the main report, the CanGrow property is set to Yes for the subreport control.

You can redesign the report in one of the following ways:

  • In the subreport, change Column Layout to Across, Then Down and, on the main report, leave the CanGrow property set to Yes for the subreport control. The subreport control will display multiple columns and expand as needed.

  • In the subreport, leave Column Layout set to Down, Then Across. On the main report, size the subreport control to fit the maximum number of records, and set its CanGrow property to No. Because the subreport control will always be the same size, if the number of records is greater than the maximum number you anticipated, records that don't fit in the subreport control will be truncated.

  • Or, instead of using a subreport, you could put the controls that print the data in the main report in a group header or the page header, and put the controls that print the data in the subreport in the detail section.

ShowSorting and grouping

ShowThe records in the groups aren't sorted

You must specify a sort order for the records in a group in the Sorting And Grouping box in report Design view. For example, if you want to sort the orders that were shipped each day by Order ID, group on Shipped Date and sort on Order ID.

ShowThe records aren't sorted in the way I expect for my language.

In a Microsoft Access database (.mdb), set the sort order for the database to the correct language in the Options dialog box.

ShowHow?

  1. On the Tools menu, click Options.

  2. Click the General tab.

  3. To specify the default language sort order for a new database, click the language that you want to use in the New database sort order box.

Note  To reset the sort order for an existing database to the language that you selected in the General tab, compact that database.