Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box in MainForm Referencing "count" in subform 2

Status
Not open for further replies.

kattzndagz

Technical User
Sep 20, 2007
13
AU
I have a main form with a subform and i am counting the number of records in the subform (it will be the number of invites sent)

The control in my [eventattendsubform] is called [countpeople] and its control source is count(*) This is placed in the footer of my subform

My control in my main form is [NoInvtnSent] and its control source is =[Forms]![eventattendsubform]![countpeople] I used the expression builder to ensure i got all the names correct.

This doesn't work as the it comes up with #Name?

I have also tried the following without success geting #Name?:

=[eventattendsubform].[Form].[RecordsetClone].[RecordCount]


It is probably something simple but i can't see it

can anyone help

thanks
 
You should be using this syntax:

=[eventattendsubform]![Forms]![countpeople]

Start with the subform's control name, then it's form collection, then the control in the form's collection.
 
MitchRandall,
Welcome to Tek-Tips. Great comment on "subform's control name" which can be confusing. However the middle section is simply "form" since it is reference the control's form object and not really a collection.

Duane
Hook'D on Access
MS Access MVP
 
Thanks Guys

This is exactly what worked for me

=[eventattendsubform].[Form].[countpeople]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top