Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / December 2007

Tip: Looking for answers? Try searching our database.

Sum in a continious form footer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chad - 19 Dec 2007 04:16 GMT
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!
Jeanette Cunningham - 19 Dec 2007 04:36 GMT
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.
[quoted text clipped - 10 lines]
> or
> point me to an example of the same thing? Thanks!
Chad - 19 Dec 2007 10:31 GMT
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!
Signature

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

> Chad,
> you will get that error if the is no value for footage.
[quoted text clipped - 20 lines]
> > or
> > point me to an example of the same thing? Thanks!
Jeanette Cunningham - 19 Dec 2007 10:48 GMT
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

> Jeanette, there is always a value in this row. I tried what you said and
> it
[quoted text clipped - 32 lines]
>> > or
>> > point me to an example of the same thing? Thanks!
Chad - 19 Dec 2007 15:07 GMT
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

Signature

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

> Chad, the #Error is Access' way of telling you that it can't find a value
> for Sum([Footage]).
[quoted text clipped - 44 lines]
> >> > or
> >> > point me to an example of the same thing? Thanks!
Tom Lake - 19 Dec 2007 19:22 GMT
> 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
Chad - 19 Dec 2007 19:53 GMT
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!
Signature

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

> > 1) FOOTAGE is a bound text box in the detail section and its bound to a
> > query.
[quoted text clipped - 7 lines]
>
> Tom Lake
Chad - 19 Dec 2007 15:10 GMT
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!
Dale Fye - 19 Dec 2007 14:40 GMT
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

Signature

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
[quoted text clipped - 5 lines]
> 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!
Chad - 19 Dec 2007 15:12 GMT
Dale, I have tried using this and I still get the #Error? This has me
stumped.....
Signature

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

> Chad,
>
[quoted text clipped - 20 lines]
> > 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!
Jeanette Cunningham - 19 Dec 2007 20:48 GMT
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

> Dale, I have tried using this and I still get the #Error? This has me
> stumped.....
[quoted text clipped - 30 lines]
>> > wrong or
>> > point me to an example of the same thing? Thanks!
Chad - 19 Dec 2007 22:43 GMT
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!
Signature

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

> Chad,
> Access will also give this error if it can find the values for Footage but
[quoted text clipped - 43 lines]
> >> > wrong or
> >> > point me to an example of the same thing? Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.