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

ID: Q197108


The information in this article applies to:

Moderate: Requires basic macro, coding, and interoperability skills.


SYMPTOMS

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


CAUSE

You may encounter this problem when the following conditions are true:

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.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


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, and then save it as qryAuthors:


  7. 
       Query: qryAuthors
       ---------------------------
       Type: Select Query
    
       Field: Last Name: au_lname
          Table: dbo_authors
          Sort: Ascending
          Field: First Name: au_fname
             Table: dbo_authors 
  8. Set the MaxRecords property of the qryAuthors query to five.


  9. On the Query menu, click Run.

    Note that the result contains only five records.


  10. Click the qryAuthors query. On the Insert menu, click AutoReport.

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



REFERENCES

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

Additional query words:


Keywords          : kbdta RptProb 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 15, 1999