No, adding the table name shouldn't make any difference. If
you did try that, you would need a dot, not a exclamation.
You need to check the name of the **field** in the form's
recordsource table/query. That is the name you must use in
the Sum function. The reason I am harping on this is that
you still seem to be using the word "field" when it looks
like you are talking about a control on the form, the Sum
function can not use a control name. Another concern I have
is that you sometimes use the name Number and at other times
you use the name Numbers.
Another possibility is if you are using a query as the
record source (please clarify), then the query might be
converting the value to a text string. This is easy to test
by changing the detail section's text box expression to:
=Price * CDbl(Numbers)
and the form's footer section text box expression to:
=Sum(Price * CDbl(Numbers))
--
Marsh
MVP [MS Access]
You said that you still think i may
be using a control name where i need to use a field name.
Is this what you mean?
= [table_name]![Price] * [table_name]![Number]
"Nordivan" skrev:
Hi, the nubers i have is an price and some of them have 4 deciamls but the
most of them have 2, so then i run on double?
I cant get the sum to work i can sum the field price but when the field
number is in the calculation in some way it dosent work. Strange but i will
try this: "I still think you may
be using a control name where you need to use a field name."
thanks for your help.
"Marshall Barton" skrev:
Double should contain the fractional part of a number. At
first I thought maybe you had the numbers FieldSize set to
Integer or Long, but Double should be ok. Depending on what
these numbers represent and what calculations use these
numbers, it might be better to use the Currency type that
can be more accurate if the numbers only have 3 or 4 decimal
places.
Note that the Format and DecimalPlaces properties are
strictly used in determining how the number is displayed,
they have no effect on the value of a field (or control).
The only point where these settings have an effect is when
you view a table/query in sheet view or when you display a
value in a text box on a form/report.
Did you get the Sum to work? If not, I still think you may
be using a control name where you need to use a field name.
Nordivan wrote:
Hi, i recall another thing. Under ech field in the table you can choose
Fieldsize, format and decimals. There i have choosen as following, Fieldsize:
Double, Format: standard and Decials: Automatic. I know this important
to.
"Marshall Barton" skrev:
Did you double check that the Numbers field in the table is
a numeric type? If the field is type Text then that would
cause the error.
Just to clarify the nomenclature, forms and reports do not
contain fields, they contain **controls**. A control can
be used to display the value of a field in the form/report's
RecordSource tabl/query. It is not unusual to use the word
field when referring to a control that displays a field's
value, but it is ambiguous when talking about both a field
and a related control in the same topic.
Nordivan wrote:
Hi, the field is called numbers both in the table and the form.
"Marshall Barton" skrev:
I suspect that the error is because the **field** in the
**table** is not named Numbers.
I haven't seen it in a long time, but I remember that there
was an issue where an error in one aggregate expression,
could cause error in other, valid expressions. Make sure
that all of them are calculating correctly before you add
the one with the problem.
Nordivan wrote:
Hi , i now think i found the fiedl tha causes the problem. I said that i
tried the expression =Sum([Price]) in all the fields that i shall use in my
calculation but the number field is filled with number so i havent tried it
but when i in one of the fileds in form footer try this expression
=Sum([Numbers]) then i get this: #Error so now i kno what causes the problem
now i just need to finsd what in the properties for the field number who
causes it.> use in my calculation
"Nordivan" skrev:
Hi, i have tried this expression =Sum([Price]) in all the fields that i shall
use in my calculation an in every of them it works, but when i try for
example to multiply the field number with the field price as an controlsource
to the field tot price it dosent work. Why?
Every field works one by one with calculations.
"kingston via AccessMonster.com" skrev:
Try the other fields one by one. Which ones work with the function Sum().
Yes, only numeric fields will work, but this may help you find fields that
you think are numeric but really aren't. Once you're sure that two fields
are numeric and both work with Sum(), try multiplying the two fields within
Sum().