Record Count

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have a form called frmOne which includes a subform
called frmTwo. I have several records in frmTwo that
change daily. I would like to have an unbound text box
in frmOne that houses only the total of records in
frmTwo. What is the best (read: easiest) way to
accomplish this?
 
The 'easiest' way to do this is to look at the record
navigation bar on the subform where that info is already
displayed if it is there.

Second easiest way is to put a textbox in the Footer of the
subform with =Count([WhateverField])

Third easiest way, and the first to actually put it where
you want it, would be to use DCount() in the unbound box
that would count the records in the subforms underlying
table based on the key linking field of the main form. Not
enough info on your tables and fields to give you the exact
syntax there.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
I tried the 3rd easiest way - the DCount() method and I
keep getting an error in the unbound text box. Since I
do not need any criteria in this command I used =DCount
([Name],Forms!frmTabDeposit) in the text box. Any
thoughts as to why I get an error here?
-----Original Message-----
The 'easiest' way to do this is to look at the record
navigation bar on the subform where that info is already
displayed if it is there.

Second easiest way is to put a textbox in the Footer of the
subform with =Count([WhateverField])

Third easiest way, and the first to actually put it where
you want it, would be to use DCount() in the unbound box
that would count the records in the subforms underlying
table based on the key linking field of the main form. Not
enough info on your tables and fields to give you the exact
syntax there.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Brian said:
I have a form called frmOne which includes a subform
called frmTwo. I have several records in frmTwo that
change daily. I would like to have an unbound text box
in frmOne that houses only the total of records in
frmTwo. What is the best (read: easiest) way to
accomplish this?


.
 
If you lookup DCount in Help, you will find that you will
probably need criteria if you don't want it to count all of
the records it finds in the table. I would think that you
just want to count how many are related to the main form
record. Not knowing anything involved, it will probably be
something like this...

=DCount("YourFieldName","YourSubFormTable","[ParentFormIDFie
ld] = " & Me!ID)

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
brian said:
I tried the 3rd easiest way - the DCount() method and I
keep getting an error in the unbound text box. Since I
do not need any criteria in this command I used =DCount
([Name],Forms!frmTabDeposit) in the text box. Any
thoughts as to why I get an error here?
-----Original Message-----
The 'easiest' way to do this is to look at the record
navigation bar on the subform where that info is already
displayed if it is there.

Second easiest way is to put a textbox in the Footer of the
subform with =Count([WhateverField])

Third easiest way, and the first to actually put it where
you want it, would be to use DCount() in the unbound box
that would count the records in the subforms underlying
table based on the key linking field of the main form. Not
enough info on your tables and fields to give you the exact
syntax there.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Brian said:
I have a form called frmOne which includes a subform
called frmTwo. I have several records in frmTwo that
change daily. I would like to have an unbound text box
in frmOne that houses only the total of records in
frmTwo. What is the best (read: easiest) way to
accomplish this?


.
 
Back
Top