Graham T
11-05-2001, 03:20 AM
I found the following code on an earlier forum post to show record count without using the default Access record selectors.
I have applied this to a number of forms and it works fine, apart from one minor point and I am wondering if this can be rectified.
The code used is as follows:
________________________________________________
Private Sub Form_Current()
'Show record Count of records displayed in form
'Uses 2 text boxes, Records and RecordNumber.
If Me.NewRecord Then
Me.RecordNumber = " "
Me.Records = " "
Else
Me.RecordNumber = Me.CurrentRecord
Me.Records = "of " & Me.RecordsetClone.RecordCount
End If
End Sub
________________________________________________
When opening the form for the first time the record count displays 1 of 1, however this should for example display 1 of 50. Once you use the forward button and then back it will show the correct count.
Can anything be amended to display the correct record count.
Thanks
I have applied this to a number of forms and it works fine, apart from one minor point and I am wondering if this can be rectified.
The code used is as follows:
________________________________________________
Private Sub Form_Current()
'Show record Count of records displayed in form
'Uses 2 text boxes, Records and RecordNumber.
If Me.NewRecord Then
Me.RecordNumber = " "
Me.Records = " "
Else
Me.RecordNumber = Me.CurrentRecord
Me.Records = "of " & Me.RecordsetClone.RecordCount
End If
End Sub
________________________________________________
When opening the form for the first time the record count displays 1 of 1, however this should for example display 1 of 50. Once you use the forward button and then back it will show the correct count.
Can anything be amended to display the correct record count.
Thanks