Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    record navigation in a form (2002)

    Instead on using the record navigation buttons that come on the bottom of a form I have been using the following code on the current event of the form to show the Record 1 of 14 in a label on my form.

    With Me.RecordsetClone
    .Bookmark = Me.Bookmark
    Me!lblNavigate.Caption = "Record " & _
    .AbsolutePosition + 1 _
    & " of " & .RecordCount
    End With

    I have used this code before with no problems but on this form when I open the form for the first time it will say Record 1 of 1 instead of Record 1 of 14. After you move to the next record the Record 2 of 14 label works correctly. Problem is only when you first open the form.
    Any ideas about what might be wrong.

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: record navigation in a form (2002)

    Immediately below the line With Me.RecordsetClone, insert a new line
    <code>
    .MoveLast
    </code>
    This forces Access to read the entire recordset, so the record count is known.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record navigation in a form (2002)

    That did it.

    Thanks

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •