Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Form_Current()
On Error GoTo Err_Form_Current
'Display the current record number and the
'Total number of records
Dim recPosition As Recordset
Dim recCount As Integer
Set recPosition = Me.RecordsetClone
recPosition.Bookmark = Me.Bookmark
If recPosition.AbsolutePosition = 0 Then
recPosition.MoveLast
recCount = recPosition.RecordCount
recPosition.MoveFirst
End If
recCount = recPosition.RecordCount
Me![txtCount] = "Record " & (recPosition.AbsolutePosition + 1) & _
" of " & recCount
recPosition.Close
Exit_Form_Current:
Exit Sub
Err_Form_Current:
'Error 3021 means recordset is at "Add New Record"
If Err = 3021 Then
Resume Exit_Form_Current
Else
MsgBox Err.Description
Resume Exit_Form_Current
End If
End Sub