Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Somewhere a while ago I found code to count records in a form. It has always worked until now.

    You put this code in the On Current event and it counts record 6 of 10 etc.

    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

    This has always worked with no problem until this new database. When the form opens it will always say record 1 of 1 until you click to the next record then it works correctly.

    I can not find what setting is different between the database where it works and in the new database where it does not work.

    Before I start spending a lot of time on this, does anyone have a suggestion.

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I don't know why it doesn't work but does it help if you insert the following line immediately below the line With Me.RecordsetClone?

    .MoveLast

  3. #3
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    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
  •