Results 1 to 5 of 5
  1. #1
    undee69 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    39

    Form Sum function

    Good day again.

    I am trying to use the =sum function on the form but i am not able to see the sum.

    I have four columns: annual leave, sick leave, special leave and absent, and I want to sum each of them



    These only works if i put zero (0) on each columns but not if there are null entry.
    is there a way to work with it having null entries?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Please show us the expression you are using as the Control Source property in the textbox in the form's Header or Footer Section.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    smytelka is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    9
    What I have done before when I have to sum with Null fields is put an expression like this in: iif([" Name of Field"] is Null,0,[" Name of Field"])

    Happy 2013

  4. #4
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Quote Originally Posted by smytelka View Post
    What I have done before when I have to sum with Null fields is put an expression like this in: iif([" Name of Field"] is Null,0,[" Name of Field"])

    Happy 2013
    Yup, this is the way to go.

    If you can, I'd change the Query your Form is based off of to return 0 if the Field is blank. If you can't, then you should be able to change the Form Controls themselves to something like =Nz([MyField],0) instead (where [MyField] is annual leave, sick leave, special leave, or absent).

    That should solve your Sum problem.

  5. #5
    undee69 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    39
    Thanks for the input guys. I've work around with those expressions in my control and I got it working now. ^_^
    Happy new year to all ^_^

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Percentage function in Form
    By glen in forum Forms
    Replies: 2
    Last Post: 12-15-2012, 03:57 AM
  2. function sum in a form
    By swrta in forum Forms
    Replies: 1
    Last Post: 01-31-2012, 06:50 AM
  3. IIF Function in a form?
    By cap.zadi in forum Forms
    Replies: 7
    Last Post: 09-17-2011, 03:42 PM
  4. Group By Function on a Form
    By amcalabrese in forum Access
    Replies: 0
    Last Post: 03-26-2011, 08:45 AM
  5. Access Form If Function
    By cs93 in forum Forms
    Replies: 1
    Last Post: 03-23-2011, 02:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums