-----Original Message-----
Place this code in a new module:
Public Function modCountRecords(F As Form)
On Error GoTo modCountRecords_Err
Dim Rs As Recordset
Set Rs = F.RecordsetClone
Rs.MoveLast
modCountRecords = Rs.RecordCount & " records"
Rs.Close
modCountRecords_Exit:
Exit Function
modCountRecords_Err:
If Err = 3021 Then
modCountRecords = 0 & " records"
Else
MsgBox Err.Description, , "Error #" & Err
End If
Resume modCountRecords_Exit
End Function
Public Function IsNewRecord(F As Form) As Integer
Dim S As String
On Error Resume Next
S = F.Bookmark
IsNewRecord = Err <> 0
End Function
Now on your form place a label and name it RecCount, now add this to
your forms OnCurrent:
Private Sub Form_Current()
If IsNewRecord(Forms!FormName) Then
Me!RecCount.Caption = "New Record"
Else
Me!RecCount.Caption = Forms!FormName.CurrentRecord & " of " &
modCountRecords(Forms!FormName)
End If
End Sub
Replace FormName with your form name.
If using code is not for you then create a textbox and add this to the
ControlSource:
=IIf([ID]="New","New Record",[Forms]![FormName]. [CurrentRecord] & " of
" & Count([ID]) & " records")
Replace [ID] with your id field. Also make the default value "New"
Hope this helps.
It is because I only want the people who use it to view
and not use it as a function. It is a very restrictive
database.
.