Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Label Record # of ## Issue 1

Status
Not open for further replies.

misscrf

Technical User
Jun 7, 2004
1,344
US
I thought I had posted this before, but I cannot seem to find the post. I have an unbound text box on a form called txtCurrRec.
It is in the footer of my main form and each subform (each on a tab control on separate pages).

In the Current of each form I have this code:
Code:
Private Sub Form_Current()

If CStr(Me.CurrentRecord) > CStr(Me.RecordsetClone.RecordCount) Then
 Me!txtCurrRec = "New Record"
 Else
 Me!txtCurrRec = CStr(Me.CurrentRecord) & " of " & _
               CStr(Me.RecordsetClone.RecordCount) & " Records"

End If
End Sub

For the main form and some subforms this works fine. For some subforms on just some records, when I navigate from the 1st subrecord to the 2nd, it suddenly says "New Record" instead of "2 of 19 Records" as it should say. It does this until I navigate to the 11th or 12th record, then the unbound text box starts working again.

I tried adding it the my cmdnext and cmdprev code so that as a user navigates it would pick it up, but that is not working either.

Would anyone have any ideas as to how I can fix this seemingly small issue?

Thanks! Happy New Year!!!


misscrf

It is never too late to become what you could have been ~ George Eliot
 
Try:
Code:
[blue]   If [purple][b]Me.NewRecord[/b][/purple] Then
      Me!txtCurrRec = "New Record"
   Else
      Me!txtCurrRec = CStr(Me.CurrentRecord) & " of " & _
                      CStr(Me.RecordsetClone.RecordCount) & " Records"
   End If[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
You rock, Aceman!!!! Thanks a bunch!


misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top