Errors with Sub Form Totals

S

Scott

I have a form/subform scenerio with text box controls for number-entry
values. In the "Form Footer" of the sub form, I'm trying to sum each of the
continious text box number controls, but the total sum text box controls
always display "#Error" message.

Although I need to use a data type like double that will handle decimal
points for the table fields in question, i've tried setting their data types
to long integer, integer and double. I've also tried every possible number
format on the sub form text box controls using the sum function.

I know that my syntax for the text box controls is correct because I've
compared the database form in question with the same kind of form/sub form
containing sum totals in the same way and they are identical.

What else could possibly be causing my sub form sum totals to be rendering
the #Error message?

Example control source: =Sum([myField1])
 
A

Al Campagna

Scott,
Could it be that the name you gave the calculated control is one of the
elements of the calculation.
That's the most common cause of #Error.
Ex. Field name = myField1, and the control source is = Sum([myField1])
This will cause an #Error.

Or, are the controls your trying to sum unbound calculations themselves?
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
S

Scott

These are bound data entry text boxes. I've tried every control naming
option available. I guess I wil have to resort to using dsum if you can't
think of anything else.

Al Campagna said:
Scott,
Could it be that the name you gave the calculated control is one of the
elements of the calculation.
That's the most common cause of #Error.
Ex. Field name = myField1, and the control source is = Sum([myField1])
This will cause an #Error.

Or, are the controls your trying to sum unbound calculations
themselves?
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Scott said:
I have a form/subform scenerio with text box controls for number-entry
values. In the "Form Footer" of the sub form, I'm trying to sum each of
the continious text box number controls, but the total sum text box
controls always display "#Error" message.

Although I need to use a data type like double that will handle decimal
points for the table fields in question, i've tried setting their data
types to long integer, integer and double. I've also tried every possible
number format on the sub form text box controls using the sum function.

I know that my syntax for the text box controls is correct because I've
compared the database form in question with the same kind of form/sub
form containing sum totals in the same way and they are identical.

What else could possibly be causing my sub form sum totals to be
rendering the #Error message?

Example control source: =Sum([myField1])
 
A

Al Campagna

Scott,
Well, someone else might pipe in on this question.
#Error can be caused by a lot of things.

You could zip the mdb, and send it to me at my website below (Contact)
Also, please put "newsgroup" in the subject line.

I'll need to know the version of Access, and a good description of what
report, and where in that report, the problem occurs.
Confidentiality assured, and no charge of course.
It just might be easier to shoot this bug by seeing the report.

If that's not do-able, or noone else jumps in, post here... that you are
starting a new post on this question, and do that new post.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Scott said:
These are bound data entry text boxes. I've tried every control naming
option available. I guess I wil have to resort to using dsum if you can't
think of anything else.

Al Campagna said:
Scott,
Could it be that the name you gave the calculated control is one of
the elements of the calculation.
That's the most common cause of #Error.
Ex. Field name = myField1, and the control source is =
Sum([myField1])
This will cause an #Error.

Or, are the controls your trying to sum unbound calculations
themselves?
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


Scott said:
I have a form/subform scenerio with text box controls for number-entry
values. In the "Form Footer" of the sub form, I'm trying to sum each of
the continious text box number controls, but the total sum text box
controls always display "#Error" message.

Although I need to use a data type like double that will handle decimal
points for the table fields in question, i've tried setting their data
types to long integer, integer and double. I've also tried every
possible number format on the sub form text box controls using the sum
function.

I know that my syntax for the text box controls is correct because I've
compared the database form in question with the same kind of form/sub
form containing sum totals in the same way and they are identical.

What else could possibly be causing my sub form sum totals to be
rendering the #Error message?

Example control source: =Sum([myField1])
 
A

Al Campagna

Scott,
Just happened to think...
Are any of your values in the column Null?
That can cause an #Error.
Let's say you have a field called [Price], and you want to add that
column, and some values are null.
In the query design, you can create a bound calculated field with...
NotNullPrice : NZ([Price],0)
Place NotNullPrice on your report, instead of Price, and...
=Sum(NotNullPrice)
should give you the total.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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