I
IanP
Hi,
I have a form consisting of 3 tabbed pages. The 1st tab contains the main
form with 2 sub forms on a the other tabs. I am trying to display the record
number on all of forms but do not want to use the record navigation buttons.
I have used the following code in the On Current event of all 3 forms to do
this;
If Me.NewRecord Then
Me!lblTotal.Caption = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblTotal.Caption = "Record " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If
This works fine on the main form but not on the subforms. When you move to
the subform tabs the label always displays "Record 1 of 1" until you start
scrolling through the records after which correct record number is shown. I
realise this is because the event runs in the On current event of the subform
but need the code to run everytime the tab onto the subform is clicked.
Any ideas how to do this?
Thanks for your time
I have a form consisting of 3 tabbed pages. The 1st tab contains the main
form with 2 sub forms on a the other tabs. I am trying to display the record
number on all of forms but do not want to use the record navigation buttons.
I have used the following code in the On Current event of all 3 forms to do
this;
If Me.NewRecord Then
Me!lblTotal.Caption = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblTotal.Caption = "Record " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If
This works fine on the main form but not on the subforms. When you move to
the subform tabs the label always displays "Record 1 of 1" until you start
scrolling through the records after which correct record number is shown. I
realise this is because the event runs in the On current event of the subform
but need the code to run everytime the tab onto the subform is clicked.
Any ideas how to do this?
Thanks for your time