Help and Support

ACC97: Report Based on Query Has More Records Than the Query

Article ID:192031
Last Review:January 23, 2007
Revision:3.1
This article was previously published under Q192031
Moderate: Requires basic macro, coding, and interoperability skills.

On This Page

SYMPTOMS

When you print or preview a report that is based on a query, it may contain more records than the query returns.

Back to the top

CAUSE

You may encounter this problem when the following conditions are true:
You create a report based on a query to an ODBC data source.

-and-
The MaxRecords property is set for that query.
Queries based on ODBC tables (such as Linked SQL Server tables) can use the MaxRecords property to limit the number of records that are returned from the ODBC data source. However, when you create a report based on a query that has the MaxRecords property set, the report ignores the MaxRecords property and returns all the rows from the data source.

Back to the top

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97.

Back to the top

MORE INFORMATION

Steps to Reproduce Problem


1.Create a data source to the SQL Server Pubs database.
2.On the File menu, point to Get External Data, and then click Link Tables.
3.In the File Of Type list, click ODBC Databases. Click Link
4.Select the data source created in step 1. Click OK.
5.Click dbo.authors, and then click OK.
6.Create the following query:
      Query: qryAuthors
      ---------------------------
      Type: Select Query

      Field: Last Name: au_lname
         Table: dbo_authors
         Sort: Ascending
      Field: First Name: au_fname
         Table: dbo_authors
						
7.Set the MaxRecords property of the query to five.
8.On the Query menu, click Run.

Notice that the result contains only five records.
9.Click the qryAuthors query. On the Insert menu, click AutoReport.

Notice that the report contains all records, not just the first five.

Back to the top

REFERENCES

For more information about the MaxRecords property, search on "maxrecords property," using the Microsoft Access Help Index.

Back to the top


APPLIES TO
Microsoft Access 97 Standard Edition

Back to the top

Keywords: 
kbbug kbpending KB192031

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.