Article ID: 128883 - Last Review: July 5, 2002 - Revision: 1.0 ACC2: How to Get "X of Y" from Record Navigation ButtonsThis article was previously published under Q128883
Moderate: Requires basic macro, coding, and interoperability skills.
On This PageSUMMARY
This article demonstrates how to create and use a sample user-defined
Access Basic function called GetXofY(). You can use this function to
retrieve the record position number (X) and the total number of records (Y)
that are displayed in the navigation buttons at the bottom of a form.
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 about Access Basic, please refer to the "Building Applications" manual. NOTE: This technique uses the undocumented recordset property AbsolutePosition which is subject to change in future versions of Microsoft Access. Use of this function is not supported by Microsoft. MORE INFORMATION
The record position number (X) in the navigation buttons does not indicate
the actual record number. Rather, it indicates the record's position in the
current record set relative to the total number of records (Y). For
example, the fifth record in a table may not have record position number 5
if the records are sorted or filtered in a different order in the form.
You can use the GetXofY() function to return a string that contains the current record position number (X) and the total number of records (Y). How to Create the GetXofY() Function in a Form
How to Use the GetXofY() Function in a FormThe following example demonstrates how to display "X of Y" in the Orders form for the Orders form and the Order Details subform:
| Article Translations
|

Back to the top
