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!

Totals from Sub Forms 2

Status
Not open for further replies.

gavinjb

Programmer
Apr 24, 2003
106
GB
hi,

I am trying to display totals which are calulated in hidden fields on my subform (fsubSalesDetails), on my main form, but I seem to be doing something wrong as all I get is an error in the text box, if I run the sub form on its own and show the total fields they work fine.

The string I am placing in the Text boxes on the main form, does anyone have any ideas what I am doing wrong

=[Forms]![fsubSalesDetails]![UnitPriceGT]
=[Forms]![fsubSalesDetails]![TotalPriceGT]
 
Hi!

Referring to subform controls from main form, could be done this way:

[tt]=Forms![frmFainForm]![fsubSalesDetails].Form![UnitPriceGT][/tt]

Here's a Microsoft link on How to Refer to a Control on a Subform or Subreport

You'll need to use the subform control name, which might differ from the name of the subform as vieved in the database window.

Roy-Vidar
 
It should be
= Me.[subform control name].Form![UnitPriceGT]
= Me.[subform control name].Form![TotalPriceGT]
(with Subform control name I mean not the name of the subform, the name of the subform control on the main form)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top