Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Forms: Duplicate "Record x of y"

Author(s)
Dev Ashish

(Q)    I'm using my own Navigation Buttons for my forms and have set the same property of the form to False.  How can I duplicate "Record x of y" label that appears in the standard Navigation toolbar?

(A)    Given that you have a label on the form called lblNavigate,   put this code
in the form's OnCurrent Event.

'************** Code Start  **************
Private Sub Form_Current()
    If Me.NewRecord Then
        Me!lblNavigate.Caption = "New Record"
    Else
        With Me.RecordsetClone
            .Bookmark = Me.Bookmark
            Me!lblNavigate.Caption = "Record " & _
                    .AbsolutePosition + 1 _
                    & " of " & .RecordCount
        End With
    End If
End Sub
'************** Code End **************

© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer