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 / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Sum/Total Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryan Hughes - 16 Jul 2005 23:03 GMT
Hello,

I have a subform that is in a continous for view.

There are 4 fields that the user inputs numbers for each record shown.

On the footer of this subform I have 4 unbound text boxes that I am trying
to put the total entered for each field every time the user adds data to
that field.

Records   Field1   Field2  Field3  Field4
Record1     3           0          5          2
Record2     6           3          0          5
Record3     0           5          3          3

Footer     Total1  Total2   Total3  Total4
                9           8            8          10

I tried making the ControlSource = SUM([FIELD1])
That did not work.

Then I tried to write a function on afterupdate to get the sums entered but
that is not working.

What am I doing wrong, and how can I solve this?

-TFTH
Bryan

Marshall Barton - 16 Jul 2005 23:34 GMT
>I have a subform that is in a continous for view.
>
[quoted text clipped - 14 lines]
>I tried making the ControlSource = SUM([FIELD1])
>That did not work.

What did it do?

Sum (in the FORM footer) always worked for me so you must be
doing something unusual.

Signature

Marsh
MVP [MS Access]

Bryan Hughes - 17 Jul 2005 02:47 GMT
It does not do anything that is the problem.

>>I have a subform that is in a continous for view.
>>
[quoted text clipped - 19 lines]
> Sum (in the FORM footer) always worked for me so you must be
> doing something unusual.
Marshall Barton - 17 Jul 2005 03:05 GMT
So, the  =Sum([Field1]) text box is just blank?  Normally,
if there's a problem, you would get #Error.

Are you sure you have the text box in the Form Footer
section and not the page footer?

Are there any other clues that might help us get a grip on
this?
Signature

Marsh
MVP [MS Access]

>It does not do anything that is the problem.
>
[quoted text clipped - 21 lines]
>> Sum (in the FORM footer) always worked for me so you must be
>> doing something unusual.
Bryan Hughes - 17 Jul 2005 02:49 GMT
It is working just not until the complete record is updated not the field.

>>I have a subform that is in a continous for view.
>>
[quoted text clipped - 19 lines]
> Sum (in the FORM footer) always worked for me so you must be
> doing something unusual.
Marshall Barton - 17 Jul 2005 17:06 GMT
Ahh, now I see what you were asking.  Here's the expression
to get the total to update as soon as the control loses the
focus:

    =Sum(Field1) - txtField1.OldValue + txtField1

Make sure that the text box's name is different than the
field it is bound to.
Signature

Marsh
MVP [MS Access]

>It is working just not until the complete record is updated not the field.
>
[quoted text clipped - 22 lines]
>> Sum (in the FORM footer) always worked for me so you must be
>> doing something unusual.
Bryan Hughes - 18 Jul 2005 18:49 GMT
Thank you Marshall,

That is what I needed.  It works great.

Bryan

> Ahh, now I see what you were asking.  Here's the expression
> to get the total to update as soon as the control loses the
[quoted text clipped - 31 lines]
>>> Sum (in the FORM footer) always worked for me so you must be
>>> doing something unusual.
Dodo - 16 Jul 2005 23:51 GMT
> Hello,
>
[quoted text clipped - 25 lines]
> Bryan
>  

Are the fields number or text format?
Bryan Hughes - 17 Jul 2005 02:47 GMT
Number

>> Hello,
>>
[quoted text clipped - 26 lines]
>
> Are the fields number or text format?
 
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.