Sum in a continious form footer

C

Chad

Hello, I am trying to sum a control from a continious forms detail section.
The form is based on a query named qrySuperlog. the text box im trying to sum
is named txtfootage and its control source is named FOOTAGE. I created an
unbound textbox in the detail section and named it txtSumOfFootage and its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and named it
txtSum with its control source =[txtSumOfFootage]. I have tried this several
ways and I keep getting an #Error. Can someone explain what im doing wrong or
point me to an example of the same thing? Thanks!
 
J

Jeanette Cunningham

Chad,
you will get that error if the is no value for footage.
Do it like this instead
=Nz(Sum([Footage]), 0)

Often, when people do this they would put txtSumOfFootage in the footer.
Try moving txtSumOfFootage to the footer and deleting txtSum.

Jeanette Cunningham
 
C

Chad

Jeanette, there is always a value in this row. I tried what you said and it
still gives an #error. Is there a setting in the properties of the form that
im missing that would cause this because im pretty sure im doing it
right....Thanks!
--
Newbies need extra loven.........


Jeanette Cunningham said:
Chad,
you will get that error if the is no value for footage.
Do it like this instead
=Nz(Sum([Footage]), 0)

Often, when people do this they would put txtSumOfFootage in the footer.
Try moving txtSumOfFootage to the footer and deleting txtSum.

Jeanette Cunningham


Chad said:
Hello, I am trying to sum a control from a continious forms detail
section.
The form is based on a query named qrySuperlog. the text box im trying to
sum
is named txtfootage and its control source is named FOOTAGE. I created an
unbound textbox in the detail section and named it txtSumOfFootage and its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and named
it
txtSum with its control source =[txtSumOfFootage]. I have tried this
several
ways and I keep getting an #Error. Can someone explain what im doing wrong
or
point me to an example of the same thing? Thanks!
 
J

Jeanette Cunningham

Chad, the #Error is Access' way of telling you that it can't find a value
for Sum([Footage]).
For some reason Access can't find each value for Footage in the subform to
be able to add them up.
How does the form get the value for each textbox that shows a value for
Footage?
Is Footage a bound textbox and what is it bound to?
Is Footage the correct name or spelling?
Is Footage a field in the recordsource for your form?

Jeanette Cunningham




Chad said:
Jeanette, there is always a value in this row. I tried what you said and
it
still gives an #error. Is there a setting in the properties of the form
that
im missing that would cause this because im pretty sure im doing it
right....Thanks!
--
Newbies need extra loven.........


Jeanette Cunningham said:
Chad,
you will get that error if the is no value for footage.
Do it like this instead
=Nz(Sum([Footage]), 0)

Often, when people do this they would put txtSumOfFootage in the footer.
Try moving txtSumOfFootage to the footer and deleting txtSum.

Jeanette Cunningham


Chad said:
Hello, I am trying to sum a control from a continious forms detail
section.
The form is based on a query named qrySuperlog. the text box im trying
to
sum
is named txtfootage and its control source is named FOOTAGE. I created
an
unbound textbox in the detail section and named it txtSumOfFootage and
its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and
named
it
txtSum with its control source =[txtSumOfFootage]. I have tried this
several
ways and I keep getting an #Error. Can someone explain what im doing
wrong
or
point me to an example of the same thing? Thanks!
 
D

Dale Fye

Chad,


Although you should not need to use the NZ function here (Sum will just
ignore null values), the rest of Jeanette's comments are on track.
1. Get rid of the txtSumOfFootage textbox in your detail section
2. in the Control source of txtSum (the control that is in the footer),
enter:

=SUM([Footage])

This should do it.

HTH
Dale
 
C

Chad

1) FOOTAGE is a bound text box in the detail section and its bound to a query.
2) FOOTAGE is the name of the field not the name of the control

--
Newbies need extra loven.........


Jeanette Cunningham said:
Chad, the #Error is Access' way of telling you that it can't find a value
for Sum([Footage]).
For some reason Access can't find each value for Footage in the subform to
be able to add them up.
How does the form get the value for each textbox that shows a value for
Footage?
Is Footage a bound textbox and what is it bound to?
Is Footage the correct name or spelling?
Is Footage a field in the recordsource for your form?

Jeanette Cunningham




Chad said:
Jeanette, there is always a value in this row. I tried what you said and
it
still gives an #error. Is there a setting in the properties of the form
that
im missing that would cause this because im pretty sure im doing it
right....Thanks!
--
Newbies need extra loven.........


Jeanette Cunningham said:
Chad,
you will get that error if the is no value for footage.
Do it like this instead
=Nz(Sum([Footage]), 0)

Often, when people do this they would put txtSumOfFootage in the footer.
Try moving txtSumOfFootage to the footer and deleting txtSum.

Jeanette Cunningham


Hello, I am trying to sum a control from a continious forms detail
section.
The form is based on a query named qrySuperlog. the text box im trying
to
sum
is named txtfootage and its control source is named FOOTAGE. I created
an
unbound textbox in the detail section and named it txtSumOfFootage and
its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and
named
it
txtSum with its control source =[txtSumOfFootage]. I have tried this
several
ways and I keep getting an #Error. Can someone explain what im doing
wrong
or
point me to an example of the same thing? Thanks!
 
C

Chad

Jeanette, I dont have a subform in this form. Its just a continious form with
a form header, detail section and a form footer. The form gets its info from
a query ran from a switchboard. Thanks!
 
C

Chad

Dale, I have tried using this and I still get the #Error? This has me
stumped.....
--
Newbies need extra loven.........


Dale Fye said:
Chad,


Although you should not need to use the NZ function here (Sum will just
ignore null values), the rest of Jeanette's comments are on track.
1. Get rid of the txtSumOfFootage textbox in your detail section
2. in the Control source of txtSum (the control that is in the footer),
enter:

=SUM([Footage])

This should do it.

HTH
Dale

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Chad said:
Hello, I am trying to sum a control from a continious forms detail section.
The form is based on a query named qrySuperlog. the text box im trying to sum
is named txtfootage and its control source is named FOOTAGE. I created an
unbound textbox in the detail section and named it txtSumOfFootage and its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and named it
txtSum with its control source =[txtSumOfFootage]. I have tried this several
ways and I keep getting an #Error. Can someone explain what im doing wrong or
point me to an example of the same thing? Thanks!
 
T

Tom Lake

Chad said:
1) FOOTAGE is a bound text box in the detail section and its bound to a
query.
2) FOOTAGE is the name of the field not the name of the control

If 1 is true then 2 is false.

1 says the control name is FOOTAGE and 2 says it's not.
If 2 is true, what *is* the name of the control that holds the value of the
FOOTAGE field?

Tom Lake
 
C

Chad

Ok, I will tru to explain! In my continious forms detail section I have a
text box named "txtFootage" and its bound source is named "FOOTAGE". This is
the box I want to sum. Now, I have another text box set to visable-falsejust
under that box so I can get the sum. This text box is unbound and its name is
"txtSumOfFootage" and its control source is =Sum([Footage]). Now in my footer
I have a unbound text box named "txtGrossFootage" and its control source is
=[txtSumOfFootage]. I get an #Error in both unbound text boxes. Now I tried
just putting an unbound text box in the forms footer with its control source
=Sum([FOOTAGE]) and I tried =[txtSumOfFootage] and I tried
=Sum([txtSumOfFootage]) and nothing works. Hope this helps.... Thanks!
 
J

Jeanette Cunningham

Chad,
Access will also give this error if it can find the values for Footage but
it can't add them up.
What is the data type for txtFootage?
Do users type a value into txtFootage?
Another way we can get at this is to get the SQL for the recordsource for
this form and total the values for Footage using the query.
If it works in the query this gives us another step along the way.
We all use txtboxes to sum values every day and don't usually have these
problems.

Jeanette Cunningham


Chad said:
Dale, I have tried using this and I still get the #Error? This has me
stumped.....
--
Newbies need extra loven.........


Dale Fye said:
Chad,


Although you should not need to use the NZ function here (Sum will just
ignore null values), the rest of Jeanette's comments are on track.
1. Get rid of the txtSumOfFootage textbox in your detail section
2. in the Control source of txtSum (the control that is in the footer),
enter:

=SUM([Footage])

This should do it.

HTH
Dale

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Chad said:
Hello, I am trying to sum a control from a continious forms detail
section.
The form is based on a query named qrySuperlog. the text box im trying
to sum
is named txtfootage and its control source is named FOOTAGE. I created
an
unbound textbox in the detail section and named it txtSumOfFootage and
its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and
named it
txtSum with its control source =[txtSumOfFootage]. I have tried this
several
ways and I keep getting an #Error. Can someone explain what im doing
wrong or
point me to an example of the same thing? Thanks!
 
C

Chad

It works now! I had two other unbound fields in the footer that was causing
everything to error. I used the =Sum([Name of field]) in the other two as
well and got rid of the hidden text boxes in the detail section and
everything works as needed! Thanks everyone for the help!
--
Newbies need extra loven.........


Jeanette Cunningham said:
Chad,
Access will also give this error if it can find the values for Footage but
it can't add them up.
What is the data type for txtFootage?
Do users type a value into txtFootage?
Another way we can get at this is to get the SQL for the recordsource for
this form and total the values for Footage using the query.
If it works in the query this gives us another step along the way.
We all use txtboxes to sum values every day and don't usually have these
problems.

Jeanette Cunningham


Chad said:
Dale, I have tried using this and I still get the #Error? This has me
stumped.....
--
Newbies need extra loven.........


Dale Fye said:
Chad,


Although you should not need to use the NZ function here (Sum will just
ignore null values), the rest of Jeanette's comments are on track.
1. Get rid of the txtSumOfFootage textbox in your detail section
2. in the Control source of txtSum (the control that is in the footer),
enter:

=SUM([Footage])

This should do it.

HTH
Dale

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



:

Hello, I am trying to sum a control from a continious forms detail
section.
The form is based on a query named qrySuperlog. the text box im trying
to sum
is named txtfootage and its control source is named FOOTAGE. I created
an
unbound textbox in the detail section and named it txtSumOfFootage and
its
control source is
=Sum([FOOTAGE]) then I created a unbound text box in the footer and
named it
txtSum with its control source =[txtSumOfFootage]. I have tried this
several
ways and I keep getting an #Error. Can someone explain what im doing
wrong or
point me to an example of the same thing? Thanks!
 

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