Rusty
Registered User.
- Local time
- Today, 17:42
- Joined
- Apr 15, 2004
- Messages
- 207
Hello there people,
I am trying to set up a couple of fields that will count the number of records on a form. (This together with some custom navigation buttons will help the users here see things a little clearer when they are moving between records).
I have used the code below and there are 5 records in total, but when the form is first opened the field [navRecNo] contains "1" and the field [navRecCount] contains "1". It's only when you go to the next record, or go to add a new record that the [navRecCount] actually contains the true number of total records, i.e. 5.
Am I missing something here??
Rusty
=========================================
Private Sub Form_Current()
Me.navRecNo = Form.CurrentRecord
Me.navRecCount = Form.RecordsetClone.RecordCount + IIf(Form.NewRecord, 1, 0) & " "
End Sub
I am trying to set up a couple of fields that will count the number of records on a form. (This together with some custom navigation buttons will help the users here see things a little clearer when they are moving between records).
I have used the code below and there are 5 records in total, but when the form is first opened the field [navRecNo] contains "1" and the field [navRecCount] contains "1". It's only when you go to the next record, or go to add a new record that the [navRecCount] actually contains the true number of total records, i.e. 5.
Am I missing something here??
Rusty
=========================================
Private Sub Form_Current()
Me.navRecNo = Form.CurrentRecord
Me.navRecCount = Form.RecordsetClone.RecordCount + IIf(Form.NewRecord, 1, 0) & " "
End Sub