Counting the number of records on a form

shaz123

Registered User.
Local time
Yesterday, 19:59
Joined
Sep 8, 2006
Messages
81
How would i count the total number of records on a form
 
The total number of records is displayed on the bottom of the form next to the record selectors.

Alternatively, you can create a text control, and use VBA code to update it to the record count using the Count funtion:
Code:
Private Sub Form_Open(Cancel As Integer)
Text11 = Count



End Sub


Oops. This totally did not work.
 
Last edited:
i wanted to show the number of records in a text box, would i put Text11 = Count in the control source of the textbox. I did try this but i appears as name?.
 
I was wrong about that.
Set the Control Source of the textbox to =Count(*)
 
New Question Please Re: Counting the number of records on a form

How does one get this field to refresh after each new record entered?

For example, When I open the form, I have 10 records and the field shows that. But let's say, I add 5 more records and the field is still showing 10 records when it should be showing 15 (without me or the user having to close and reopen the form each time to get an accurate total).

If I select the textbox for =Count(*) in form design, Go to the property sheet, event tab ... Would I choose "after update" for "code builder"? Or something else?

What code would I use? My code knowledge is zero. I will sincerely appreciate any help here. Thanks!

UPDATE ...

I also have a save record button on my form, I should have mentioned that. My apologies.

So one SAVES the record, then how do I get the count textbox to recognize the new entry?

Thank you!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom