Results 1 to 3 of 3
  1. #1
    Grumpy Ump is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2019
    Posts
    2

    Using Calculated fields to create a total of the fields indicated,

    I am trying to create a DB for my Brother in Law.
    He's been using a MS Works DB, but he's now having to replace his current Windows 7 laptop with a Windows 10 OS.
    MS Works is not supported.
    I have tried to use [field1]+[field2]+[field3] etc. i need to be able to add together the figures from approximatly 18 fields.

    The figure appears when all the fields are populated, but give incorrect or no answer when a blank field is present.

    Can anyone tell me where I am going wrong?

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    This might make you less grumpy. Code will check for nulls and replace with zero.
    NZ([Field1],0) + NZ([Field2],0) + etc.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Arithmetic with Null returns Null.

    Have to think this is not a normalized structure. Appear to have fallen into trap of "spreadsheetitis" - retaining a spreadsheet structure in a relational database. Probably should have a related dependent table where each of the 18 field inputs would be a separate record. Then an aggregate query to Sum records.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-12-2017, 07:39 AM
  2. Replies: 1
    Last Post: 04-26-2016, 01:13 AM
  3. Replies: 6
    Last Post: 09-01-2015, 02:27 PM
  4. Replies: 2
    Last Post: 04-22-2015, 12:28 PM
  5. Replies: 12
    Last Post: 10-01-2013, 12:59 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