"Cillies" <le*@prologic.ie> wrote in message
news:ba**************************@posting.google.c om...
Hi, I want to display the number of records in a form on an access
2002 database.
I know that under properties you can select navigation button, which
allows the user to flick through the records and see which record
number it is and how many records there are.
But I want to be able to display the number of records myself on the
form, without using the access version.
Kindest regards
Create the following function:
--------------------------------------------------
Public Function NumRecs() As Long
Dim RS As Recordset
Set RS = CodeContextObject.RecordsetClone
If RS.RecordCount Then
RS.MoveLast
NumRecs = RS.RecordCount
Else
NumRecs = 0
End If
End Function
-------------------------------------------------
In a Textbox on your form put =NumRecs()
on its Control Source.
Ciao
Bruno