ACC: Adding Dynamic Counter to Query to Count Records (94397)
The information in this article applies to:
- Microsoft Access 1.0
- Microsoft Access 1.1
- Microsoft Access 2.0
This article was previously published under Q94397 Advanced: Requires expert coding, interoperability, and multiuser skills.
SUMMARY
This article describes how to use a dynamic counter value in a query field
for the following purposes:
- Returning the top x number of records to ship in a Microsoft Access version 1.x query.
NOTE: In Microsoft Access versions 2.0 you can use the
TopValues query property to accomplish this.
- Displaying the record's position number on a form. For more information
about this topic, query on the following words here in the Microsoft
Knowledge base:
record and position and number and form
- Printing the top x number of records on a report. For more information
about this topic, query on the following words here in the Microsoft
Knowledge Base:
top and 10 and records and report
NOTE: If the report includes totals, totals will be displayed for all
the records, not just the top x number of records. To total only the top
x number of records, limit the records included in the report using the
method described later in this article.
This article assumes that you are familiar with Access Basic and with
creating Microsoft Access applications using the programming tools provided
with Microsoft Access. For more information on Access Basic, please refer
to the "Introduction to Programming" manual in Microsoft Access version
1.x, or the "Building Applications" manual in version 2.0.
REFERENCES
For information about when functions are executed in queries, please
see the following article in the Microsoft Knowledge Base:
98788 ACC: Number of Times a Custom Function Executes in a Query
Modification Type: | Major | Last Reviewed: | 5/9/2003 |
---|
Keywords: | kbhowto kbusage KB94397 |
---|
|