Record # of Records

‘This function places the number of the current record and the total number of records in a text box (txtRecordNumber).

Private Sub Form_Current()

Dim rst As DAO.Recordset
Dim lngCount As Long

Set rst = Me.RecordsetClone

With rst
    .MoveFirst
    .MoveLast
    lngCount = .RecordCount
End With

Me.txtRecordNumber = "Record number " & Me.CurrentRecord & " of " & lngCount & " records"

End Sub

Home