Subreport RecordCount

K

Keith Wilby

What's the syntax I need to use to return a subreport's record count
property from its parent report? I've tried

Me.srptSubReportObject.RecordCount

and

Me.srptSubReportObject.RecordsetClone.RecordCount

in the report's Open even but that isn't it.

Many thanks.

Keith.
 
A

Al Campagna

Keith,
I usually just... (assuming a continuos subform... not datasheet)
=Count(SomeKeyField) '(ex. control name = SubRecCount)
in the footer of the subform.
The main form could refer to that value when needed...
Forms!frmMainForm!frmSubform.Form!SubRecCount
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
 
K

Keith Wilby

Al Campagna said:
Keith,
I usually just... (assuming a continuos subform... not datasheet)
=Count(SomeKeyField) '(ex. control name = SubRecCount)
in the footer of the subform.
The main form could refer to that value when needed...
Forms!frmMainForm!frmSubform.Form!SubRecCount

Hi Al and thanks for responding. I'm working with reports and not forms and
can't get your solution to work. Have I missed the obvious?

Thanks.

Keith.
 
K

Keith Wilby

Spoke too soon. I needed the code in the main report detail's After Format
event (the subs format before the main IIRC). Many thanks for the tip.

Keith.
 

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