Replace navigation buttons,Record X of Y

  • Thread starter Tom K via AccessMonster.com
  • Start date
T

Tom K via AccessMonster.com

Hi,
Im using the code from "The Access Web"site. The code duplicates the
navigation buttons, "Duplicate Record X of Y". It works great, but when I
first open my form it only displays 1 of 1, even though there are many
records. It changes to what it should be as soon as I move to a different
record. Is there a way to have it display the correct number of records at
the form opening? Is there somthing I could add to the code? Could I move to
the last record and then to the first when I open the form, and how would I
do that? This is the code Im using:

Private Sub Form_Current()
If Me.NewRecord Then
Me!lblNavigate.Caption = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblNavigate.Caption = "Record " &_
& " of " & .RecordCount
End With
End If
End Sub

I also included a label on the form called lblNavigate. The code is found at
www.mvps.org/access.htm


Thanks,
tom
 
D

Douglas J Steele

See whether putting

Me.RecordsetClone.MoveLast

in the form's Load event helps.
 
T

Tom K via AccessMonster.com

Thanks,
It does work, I used
Me.RecordsetClone.MoveLast
Me.RecordsetClone.MoveFirst
It worked great,

Tom
See whether putting

Me.RecordsetClone.MoveLast

in the form's Load event helps.
Hi,
Im using the code from "The Access Web"site. The code duplicates the
[quoted text clipped - 23 lines]
Thanks,
tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top