Results 1 to 9 of 9
  1. #1
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146

    calc field


    I am using access 2003 and using xp-pro for an o/s. I have a form that has a field call total income. I total the income from a column named Total cost. I use =Sum([Total Cost]). This works perfect but would like to filter it. I have another column named Paid and it is a yes/no source. I would like to add the yes to the above calculation so the Sum only reflects the records that are marked as paid with the check mark. Any idea's??

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Could filter the form's RecordSet to exclude the No records.

    Or try:
    Sum(IIf([Paid]=True,[Total Cost],0))
    Last edited by June7; 11-09-2011 at 03:17 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146
    Is there an expression that I can put directly in the text field instead of code??

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Try that same expression in ControlSource of textbox in form footer. I don't have any forms that require aggregate calcs but think I have seen that work for others.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146
    I tried this and in the text field I get #Name? instead of a number

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That usually means Access can't find one or more of the references in the expression. Are those fields in the form's RecordSource? Are those the actual correct spellings for the names?
    Last edited by June7; 11-09-2011 at 08:52 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146
    Sum(IIf([Paid]=True,[Total Cost],0))I checked the sources on the table and the names are good. I'm not sure what else it could be......

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    An expression in ControlSource must have = sign. Lack of will also cause that error. Without it, is just a string of text that Access can't understand.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    nashr1928 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    146
    Gee's. Yeah I forgot that. I put =Sum and it works perfect. Thanks so much for your help in solving this. Rick

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

Similar Threads

  1. Replies: 1
    Last Post: 06-04-2012, 07:17 PM
  2. Replies: 3
    Last Post: 10-03-2011, 02:33 PM
  3. Calc fields
    By nashr1928 in forum Forms
    Replies: 5
    Last Post: 02-26-2011, 08:35 PM
  4. Replies: 9
    Last Post: 12-15-2010, 01:44 PM
  5. Replies: 1
    Last Post: 02-26-2009, 11:31 AM

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