Counting number of records in a table


R

Rosemary

Hello,

I have a main form which was created from a table that
holds case records (about 1500 records). The name of the
case is the name of the patient who is the head of the
household. Within that main form, I have a subform
created from a table that holds the names of all the
family members (including head of household) in each
case. The total records in the subform is over 1800.

The navigation bar for the main form shows the number of
cases. The navigation bar for the subform shows the
number of people in each case.

We would like a way to see the total number of patients,
which would come from the table from which the subform
was created. I understand to do this I need to create a
function in a module, then attach the module to a textbox
which will appear on the subform.

Does anyone have an example of a function that will count
the number of records in a subform and display them in a
textbox?

Many thanks,
Rosemary
 
Ad

Advertisements

M

MikeC

Rosemary,

Built-in functions are already available that can count
records.

You can add a text box control to the subform and set
the "Control Source" property to:

=DCount("[YourSubformTableID]","YourSubformTable")
 
Ad

Advertisements

R

Rosemary

Thanks!!

-----Original Message-----
Rosemary,

Built-in functions are already available that can count
records.

You can add a text box control to the subform and set
the "Control Source" property to:

=DCount("[YourSubformTableID]","YourSubformTable")



-----Original Message-----
Hello,

I have a main form which was created from a table that
holds case records (about 1500 records). The name of the
case is the name of the patient who is the head of the
household. Within that main form, I have a subform
created from a table that holds the names of all the
family members (including head of household) in each
case. The total records in the subform is over 1800.

The navigation bar for the main form shows the number of
cases. The navigation bar for the subform shows the
number of people in each case.

We would like a way to see the total number of patients,
which would come from the table from which the subform
was created. I understand to do this I need to create a
function in a module, then attach the module to a textbox
which will appear on the subform.

Does anyone have an example of a function that will count
the number of records in a subform and display them in a
textbox?

Many thanks,
Rosemary

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top