Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting record count. 3

Status
Not open for further replies.

Eradic8or

Programmer
Oct 29, 2000
159
GB
Can anyone tell me how I display the number of records retrieved from a query on a form.
I am trying to display "Record 1 of xxx ". I know I can use the currentrecord property to display the current record, but is there a property for the number of records.

I have the navigation buttons turned off before someone recommends them. I want to use my own. I have also tried DCount but that just returns errors.
Surely, there must be a fixed property for this.

By the way, I am talking about Access 97 (I know, I know).

Cheers,
 
set the control source for the text field to

"=Count([fieldname])"

fieldname should be a field on your form that displays ALL of the records [not a calculated field].

HTH




Sam_F
"90% of the problem is asking the right question.
 
this updates a label with Rec # of Records


Private Sub Form_Current()
If Me.NewRecord = False Then
Me.RecordsetClone.Bookmark = Me.Bookmark
Me.lblRecCount.Caption = "Record " & _
Me.RecordsetClone.AbsolutePosition + 1 _
& " Of " & Me.RecordsetClone.RecordCount
End If
End Sub
 
Thanks for the replies guys.
The "=Count([fieldname])" answer worked a treat.

PaulF, your solution also provided the answer to another problem I had. Once again, thanks.
 
Paul, I have played with the displaying this different ways. This is the best.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top