Count Sub-form Records

TallMan

Registered User.
Local time
Today, 14:42
Joined
Dec 5, 2008
Messages
239
Good Afternoon!

I believe I have an easy one for you guys. I have a form with a subform on it. I want to have an unbound text box on the form that tells me how many rows are in the subform. Is there an easy way to do this?

I have tried putting a SQL statement in the "control source" of text box along with trying the count function as well.

The text box is called Snip_Count
the Form is called DD_Unmanged_Assets
the subform is called DD_Snip_TBL subform

Also, I took away the navigation buttons at the bottom, and I do not want to bring them back.

Thanks in advance guys!

TALLMAN:p
 
in the Snip_Count ControlSource property you put:
=count(DD_Snip_TBL subform.FieldName)

FieldName can be any field on the subform
 
Hmmmm....I am still getting an "#error" in the text box. I tried putting your text directly, obviously with a correct field name as well as adding brackets....still no luck.
 
try to use this:

= count([DD_Snip_TBL subform].Form![FieldName])

you can also put the count as hidden field on the footer of the SubForm:
= count([FieldName])

and from the main form call to it:
= [DD_Snip_TBL subform].Form![count_FieldName]
 
Let me try the second option you mentioned. About putting it on the foot of the subform and then calling to it.
 
Got it to work~!!! Thank you very much for your help!:):)
 
:)

when things like this are not going it's better first try on the subform footer making sure all names are correct.

don't hesitate to ask for any other help you need
 

Users who are viewing this thread

Back
Top Bottom