Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Using the following code in the current event of a form to show the number of the current record.

    Dim i As Integer
    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

    It works but the first time you open the form it only shows Record 1 of 1. After you go to the next record it works properly.

    There is a line of code you can add that forces the database to go to the last record first and then this number coding works. I have done this before but I can not remember the code.

    Can someone help.

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    After With Me.RecordsetClone, insert a line

    .MoveLast


  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks again.

    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
  •