+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Sum in form footer (Access 2003)

  1. #1
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Question Sum in form footer (Access 2003)

    Hello again. Working with Access 2003.

    I'm trying to put a running Sum into a Form Footer. I put the text box in the Form Footer and created this Expression in the Control Source:

    =Sum([H0310]+[H0615]+[H0715]+[H1014]+[H1314]+[SS0312]+[SS0317]+[SS0619]+[SS0712]+[SS1012])
    Where H0310, H0615, etc...are the Names of the fields.

    I'm getting a #Error in the new text box.

    The format of each fields control source is Number and the format of the new text box is General Number.

    Any ideas?
    Thanks!
    Last edited by WillysK5; 05-26-2009 at 04:30 PM.

  2. #2
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Bumpity bump bump

    Any help would be greatly appreciated!

  3. #3
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Sum in form footer (Access 2003)

    Hi WillysK5,

    Try removing the Sum function so the control source looks like this:

    =[H0310]+[H0615]+[H0715]+[H1014]+[H1314]+[SS0312]+[SS0317]+[SS0619]+[SS0712]+[SS1012]
    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  4. #4
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Thanks Conne, but it just leaves it blank now. There's no #Error, but there's no total either.

    WillysK5

  5. #5
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Sum in form footer (Access 2003)

    Is the form looking at an existing record (not a new record) with data in those fields?
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  6. #6
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Quote Originally Posted by ConneXionLost View Post
    Is the form looking at an existing record (not a new record) with data in those fields?
    Both. The main function is as a running total in a new form, but it doesn't do that or show up in an existing record.

    And yes, there are existing records for it to look at...

  7. #7
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Sum in form footer (Access 2003)

    Let me start with this is total speculation. There is no knowledge behind what I am about to say. If it sees the fields as being empty or null it won't give them a 0 value thus resulting in a Err or blank. Total guess, so take that for what it is worth, I would try the following.

    =Nz([H0310],0)+Nz([H0615],0)+Nz([H0715],0)+Nz([H1014],0)+Nz([H1314],0)+Nz([SS0312],0)+Nz([SS0317],0)+Nz([SS0619],0)+Nz([SS0712],0)+Nz([SS1012],0)
    Hope this helps,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  8. #8
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Thanks Dan, but that gives me an invalid syntax message.



    I just wish I knew more about Access expressions.....

  9. #9
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Sum in form footer (Access 2003)

    Hi WillysK5,

    I built a mock-up to test the formula, and it works fine, but that isn't helping here. The only way I can reproduce this error is by disconnecting the Record Source for the form (or by removing one of the Record Source fields).

    Probably a dumb question, but do you still have a Record Source connected to the form?

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  10. #10
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Yeah. I have one table where all the data from that one form is stored. It's named in the Record Source of that form.

  11. #11
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Sum in form footer (Access 2003)

    Quote Originally Posted by ConneXionLost View Post
    Hi WillysK5,

    I built a mock-up to test the formula, and it works fine, but that isn't helping here. The only way I can reproduce this error is by disconnecting the Record Source for the form (or by removing one of the Record Source fields).

    Probably a dumb question, but do you still have a Record Source connected to the form?

    Cheers,
    I did a similar, however I got a blank when one of the fields was null, I may have screwed up the syntax. I am gonna try another thing quick.
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  12. #12
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Sum in form footer (Access 2003)

    Hi WillysK5,

    Okay, really grasping at straws now; any chance you used Captions in your table and are using them instead of the Field Names in the formula?

    Note - I'm running out of guesses!

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  13. #13
    Valued Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Sum in form footer (Access 2003)

    =Nz([H0310])+Nz([H0615])+Nz([H0715])+Nz([H1014])+Nz([H1314])+Nz([SS0312])+Nz([SS0317])+Nz([SS0619])+Nz([SS0712])+Nz([SS1012])
    Try that,

    I just checked it with mine, no syntax error, unless one of the field names if off on yours.
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  14. #14
    Registered User
    Join Date
    05-20-2008
    MS-Off Ver
    2003 suite
    Posts
    64

    Re: Sum in form footer (Access 2003)

    Woohoo! That's it! I forgot a parenthesis.

    Thanks!!

  15. #15
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Sum in form footer (Access 2003)

    Great!

    So in your table, you might want to set the default values for those fields to zero "0" instead of blank.

    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0