Control source for text box on a form

wildexodus

Registered User.
Local time
Today, 03:33
Joined
Feb 6, 2003
Messages
74
I have a form with a text box on it and also a subform. I want the text box to calculate the sum of a field in the subform. What is the control source code for this?
 
=Sum([Forms]![subFormname]![subformtextboxname])

Change names accordingly...
 
tried that. It says #error.

Its frmOrder
 

Attachments

FYI - The sample Northwind database has an example of how to do this...on the form called Orders.
 
Looking at your Form, you are trying to Sum based on the Form Footer. You need to add a Footer for the Order Number, then Sum this on your subform. You can then point the Main form to this subform box.

Hope that makes sense. If you need an example, see the Northwind sample DB.
 
He...nice Elana...just missed your post...

:D
 
would this work?

me!yourSubformName.form!yourTextboxName
 
would this work?

me!yourSubformName.form!yourTextboxName

No, it brings up #Name in the txt box.
 
=Sum([YourField]) as the control source of an unbound textbox in the subform footer
 
I've done that but i still get #error in the text box thats on the main form.

I've looked at the northwind and done what they've done but its still not working. I think i may have missed something somewhere.
 

Attachments

It's:

=[frmOrderSubform].[Form]![txtsub]

but it keeps changing itself to:

=frmOrderSubform.Form!txtsub
 
The error is occurring in your subform subtotal text box - not in the reference to the text box. I'm looking at it and trying to figure it out.
 
Set the control source of txtSub to =sum([expr1])
 

Users who are viewing this thread

Back
Top Bottom