Summing Values entered into forms

  • Thread starter Thread starter Eswift
  • Start date Start date
E

Eswift

If you have several surcharges in a form where you
manually enter the data in, how do you have a total line
that will sum all the fields above with surcharges? I
went into the total line field, properties, then build
event with Expression Builder. =value1+value2+value3
etc. But it doesn't work. What am I missing??? Thank
you for your help in advance. - E
 
Check:

- That all controls in the expression are numeric
- That there are no name conflicts between either Access
reserved words, or between control names and underlying
field names. E.g., it's generally good practice to name
your control something that identifies its type and
differentiates it from the table field entered in its
Control Source, e.g., cboCustomerID.
- That control names in your expression are enclosed in
brackets []
- That you entered the expression in the Control Source
property of the summary field
- If you are using any summary fields from a subform,
place an invisible control on your main form whose Control
Source is set equal to the summary control, e.g.,
=Me!subformcontrolname.Form!subformsummarycontrolname

If none of these help, post your expression, and the
Control Source of each control referred to.

HTH
Kevin Sprinkel
 
Thanks Kevin for responding! Unfortunatly It seems that I
do not have a clue? ha ha ha.. I do not know what you
mean by (=Me!subformcontrolname.Form!
subformsummarycontrolname) Perhaps you can explain that
to me? This is what is in my control source for my total
field in my form. Thanks again for your help!!

= [CMCR Table]![Set-up Surcharge] + [CMCR Table]![Audio-
Visual Surcharge] + [CMCR Table]![Hosted Bar PP] + [CMCR
Table]![Cash Bar Hourly] + [CMCR Table]![Drink Tickets
PP] + [CMCR Table]![Hors D'oeuvres PP] + [CMCR Table]!
[Entree 1 PP] + [CMCR Table]![Entree 2 PP] + [CMCR Table]!
[Entree 3 PP] + [CMCR Table]![Desert PP] + [CMCR Table]!
[Wedding Cake Surcharge] + [CMCR Table]![Candlebra
Surcharge] + [CMCR Table]![Champagne Toast Surcharge] +
[CMCR Table]![Tables Surcharge] + [CMCR Table]![Guest
Book Table Surcharge] + [CMCR Table]![Gift Table
Surcharge] + [CMCR Table]![Linens Surcharge] + [CMCR
Table]![Napkins Surcharge] + [CMCR Table]![Centerpieces
Surcharge] + [CMCR Table]![Dance Floor Surcharge] + [CMCR
Table]![Media Show Surcharge] + [CMCR Table]!
[Entertainment Surcharge] + [CMCR Table]![Photographer
Surcharge] + [CMCR Table]![Florist Surcharge] + [CMCR
Table]![Favors, programs, decorations surcharge] «Expr»
[CMCR Table]![Service Charges] - [CMCR Table]![Discount]


-----Original Message-----
Check:

- That all controls in the expression are numeric
- That there are no name conflicts between either Access
reserved words, or between control names and underlying
field names. E.g., it's generally good practice to name
your control something that identifies its type and
differentiates it from the table field entered in its
Control Source, e.g., cboCustomerID.
- That control names in your expression are enclosed in
brackets []
- That you entered the expression in the Control Source
property of the summary field
- If you are using any summary fields from a subform,
place an invisible control on your main form whose Control
Source is set equal to the summary control, e.g.,
=Me!subformcontrolname.Form!subformsummarycontrolname

If none of these help, post your expression, and the
Control Source of each control referred to.

HTH
Kevin Sprinkel

-----Original Message-----
If you have several surcharges in a form where you
manually enter the data in, how do you have a total line
that will sum all the fields above with surcharges? I
went into the total line field, properties, then build
event with Expression Builder. =value1+value2+value3
etc. But it doesn't work. What am I missing??? Thank
you for your help in advance. - E
.
.
 
I just added Sales Price=(expression found below) .. and
I get a #NAME? error in the field!!! I think I am getting
closer! ha ha ha
-----Original Message-----
Check:

- That all controls in the expression are numeric
- That there are no name conflicts between either Access
reserved words, or between control names and underlying
field names. E.g., it's generally good practice to name
your control something that identifies its type and
differentiates it from the table field entered in its
Control Source, e.g., cboCustomerID.
- That control names in your expression are enclosed in
brackets []
- That you entered the expression in the Control Source
property of the summary field
- If you are using any summary fields from a subform,
place an invisible control on your main form whose Control
Source is set equal to the summary control, e.g.,
=Me!subformcontrolname.Form!subformsummarycontrolname

If none of these help, post your expression, and the
Control Source of each control referred to.

HTH
Kevin Sprinkel

-----Original Message-----
If you have several surcharges in a form where you
manually enter the data in, how do you have a total line
that will sum all the fields above with surcharges? I
went into the total line field, properties, then build
event with Expression Builder. =value1+value2+value3
etc. But it doesn't work. What am I missing??? Thank
you for your help in advance. - E
.
.
 
Your expression has <<expr>> in it near the end, which I
think should be a plus sign. Remove the Sales Total which
you added.

Re: Me!subform...etc.

This is a reference to a subform control from a control on
a main form. See VBA help on Collections for a full
description of how to refer to various controls or other
objects. In this case, Me! is a shorthand reference to
the current form in the current database, which formally
would be referred to Forms!yourformname, e.g., Forms!
OrderEntryForm. A subform is itself a control on the main
form, so to get at one of its controls, you must specify
the subform control name, followed by .Form!, followed by
the specific control name you're after. Say you had a
summary control on an order entry subform that totaled the
extended prices of all the order items. Its Control
Source might be: =Sum([ExtdPrice]). Let's say its name
is SumOfExtdPrice, and that the subform control's name is
sbfOrderDetail. To get that value into a control on the
main form, the syntax is:

= Me!sbfOrderDetail.Form!SumofExtdPrice

HTH

Let me know if this didn't solve your problem.

Best regards.
Kevin Sprinkel
-----Original Message-----
Thanks Kevin for responding! Unfortunatly It seems that I
do not have a clue? ha ha ha.. I do not know what you
mean by (=Me!subformcontrolname.Form!
subformsummarycontrolname) Perhaps you can explain that
to me? This is what is in my control source for my total
field in my form. Thanks again for your help!!

= [CMCR Table]![Set-up Surcharge] + [CMCR Table]![Audio-
Visual Surcharge] + [CMCR Table]![Hosted Bar PP] + [CMCR
Table]![Cash Bar Hourly] + [CMCR Table]![Drink Tickets
PP] + [CMCR Table]![Hors D'oeuvres PP] + [CMCR Table]!
[Entree 1 PP] + [CMCR Table]![Entree 2 PP] + [CMCR Table]!
[Entree 3 PP] + [CMCR Table]![Desert PP] + [CMCR Table]!
[Wedding Cake Surcharge] + [CMCR Table]![Candlebra
Surcharge] + [CMCR Table]![Champagne Toast Surcharge] +
[CMCR Table]![Tables Surcharge] + [CMCR Table]![Guest
Book Table Surcharge] + [CMCR Table]![Gift Table
Surcharge] + [CMCR Table]![Linens Surcharge] + [CMCR
Table]![Napkins Surcharge] + [CMCR Table]![Centerpieces
Surcharge] + [CMCR Table]![Dance Floor Surcharge] + [CMCR
Table]![Media Show Surcharge] + [CMCR Table]!
[Entertainment Surcharge] + [CMCR Table]![Photographer
Surcharge] + [CMCR Table]![Florist Surcharge] + [CMCR
Table]![Favors, programs, decorations surcharge] «Expr»
[CMCR Table]![Service Charges] - [CMCR Table]![Discount]


-----Original Message-----
Check:

- That all controls in the expression are numeric
- That there are no name conflicts between either Access
reserved words, or between control names and underlying
field names. E.g., it's generally good practice to name
your control something that identifies its type and
differentiates it from the table field entered in its
Control Source, e.g., cboCustomerID.
- That control names in your expression are enclosed in
brackets []
- That you entered the expression in the Control Source
property of the summary field
- If you are using any summary fields from a subform,
place an invisible control on your main form whose Control
Source is set equal to the summary control, e.g.,
=Me!subformcontrolname.Form!subformsummarycontrolname

If none of these help, post your expression, and the
Control Source of each control referred to.

HTH
Kevin Sprinkel

-----Original Message-----
If you have several surcharges in a form where you
manually enter the data in, how do you have a total line
that will sum all the fields above with surcharges? I
went into the total line field, properties, then build
event with Expression Builder. =value1+value2+value3
etc. But it doesn't work. What am I missing??? Thank
you for your help in advance. - E
.
.
.
 
Back
Top