ACC2: How to Get "X of Y" from Record Navigation ButtonsLast reviewed: April 2, 1997Article ID: Q128883 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. 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 INFORMATIONThe 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:
|
Keywords : FmsHowto kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |