Aggregate # of records displayed on a form

  • Thread starter Thread starter Frank Camean
  • Start date Start date
F

Frank Camean

What is the formula that can be used to display an
aggregate count of records and display it on a form? Is
it DCount? I tried but am having no luck.

On a blank form, I've inserted a text box. On the
properties I've selected Expression Builder. The field
name on the form is TOTALCONTACTS. I want this field to
dispaly the total number of contacts in my DB. What's the
correct formula? I keep getting #Name?.

Any information will help. Thanks.

Frank
 
Frank Camean said:
What is the formula that can be used to display an
aggregate count of records and display it on a form? Is
it DCount? I tried but am having no luck.

On a blank form, I've inserted a text box. On the
properties I've selected Expression Builder. The field
name on the form is TOTALCONTACTS. I want this field to
dispaly the total number of contacts in my DB. What's the
correct formula? I keep getting #Name?.

Any information will help. Thanks.

Frank

Are you wanting to display a count of the number of records displayed on
that form, or a count of the records in some independent table? For a
count of the records currently in the form's recordset, you can use

=Count(*)

as the ControlSource of a text box. If you want to show the number of
records in, say "tblContacts", you can use a DCount expression in the
text box's ControlSource:

=DCount("*", "tblContacts")

In either case, if the form is bound to a table or query, the name of
the text box you use cannot be the same as the name of a field in the
form's RecordSource.
 
Dirk,

Thank you very much. That worked perfectly. I was trying
to grab the number of records from an independent table
without have the form bound to any table or query. Your
advice worked the way I wanted it to.

I also greatly apologize for the double posting on the
other newsgroup. My apologies. Please forgive my
ignorance. My first time posting here. Thanks so much.

Frank
 
Back
Top