Displaying the Total from a Subform on a Main form

G

Guest

I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
 
G

Guest

No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

schasteen said:
Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
Lucy said:
I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

The squarebrackets probably disappeared since they are not needed since there
are no spaces in the names of your form or textbox. Did you get the same
error message?

Lucy said:
No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

schasteen said:
Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
Lucy said:
I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

Yes I did:
#NAME?

schasteen said:
The squarebrackets probably disappeared since they are not needed since there
are no spaces in the names of your form or textbox. Did you get the same
error message?

Lucy said:
No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

schasteen said:
Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
:

I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

An easier way is in design view, click in the control sourc box of the text
box that you want the data to show in, to the right click on the 3 dots
(...), this will bring up the expression builder, delete any experssion
already there, click on the forms name and it should then show the subform
under it, click on the subforms name and the middle column should show all
controls in the subform, double click on the one you would like, click OK.

schasteen said:
The squarebrackets probably disappeared since they are not needed since there
are no spaces in the names of your form or textbox. Did you get the same
error message?

Lucy said:
No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

schasteen said:
Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
:

I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

thats how i originally entered the expression and the error message is still
appearing.

schasteen said:
An easier way is in design view, click in the control sourc box of the text
box that you want the data to show in, to the right click on the 3 dots
(...), this will bring up the expression builder, delete any experssion
already there, click on the forms name and it should then show the subform
under it, click on the subforms name and the middle column should show all
controls in the subform, double click on the one you would like, click OK.

schasteen said:
The squarebrackets probably disappeared since they are not needed since there
are no spaces in the names of your form or textbox. Did you get the same
error message?

Lucy said:
No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

:

Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
:

I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 
G

Guest

Is the textbox in the subform showing the data correctly?

Lucy said:
thats how i originally entered the expression and the error message is still
appearing.

schasteen said:
An easier way is in design view, click in the control sourc box of the text
box that you want the data to show in, to the right click on the 3 dots
(...), this will bring up the expression builder, delete any experssion
already there, click on the forms name and it should then show the subform
under it, click on the subforms name and the middle column should show all
controls in the subform, double click on the one you would like, click OK.

schasteen said:
The squarebrackets probably disappeared since they are not needed since there
are no spaces in the names of your form or textbox. Did you get the same
error message?

:

No none of those work. everytime i change to form view and then back to
design view all of the square brackets [] dissapear. this was the same for
all three expressions. nothing I do seems to work.

:

Try
=[Invoicesubform].form![ordersubtotal]
or
=Me.[Invoicesubform].form![ordersubtotal]
:

I have entered the following expression as the control source of a textbox
(total cost) on a subform(Invoicesubform):
=sum[stock quantity] * [unit cost]
In the footer of this subform i have made a text box(ordersubtotal) with the
control source being:
=sum [(Total Cost)]
This should show the sub-total of all the total costs. I then want this to
appear on the main form. again i created a textbox and entered the following
expression as the control source:
=Forms![Invoicesubform]![ordersubtotal]
when the main form is shown in form view the sub-total text box shows the
following:
#NAME?
Have I done something wrong? I have based these expressions from the
Northwind Sample Database.

Lucy
 

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