Results 1 to 5 of 5
  1. #1
    danieltaylor is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    12

    Question using Nz function in a field

    Hi to all,


    I have a Nz function in my data entry form and i put it to an unbound text field to sum the values from 5 fields, now i want that value (the result of the Nz function) to be stored on my table. how can i do this??? any help pls...

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,746
    More info please. Can you give us an example of what you are doing?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe this link will help: http://allenbrowne.com/casu-14.html

  4. #4
    danieltaylor is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    12
    well it goes like this: there a 5 fields that i want to add [1], [2], [3], [4], [5] in my table, and [6] will store the result. but there times that 1 or more fileds will be empty/null so in my data entry form i used the function: Nz([1],0)+Nz([2],0)+Nz([3],0)+Nz([4],0)+Nz([5],0) which i put on unbound field, now i want to store its result to [6] in my table, or is there any other way sum fields in which some are empty that the result will be stored on the table...
    thanks....

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,746
    You don't store calculated fields in a table. You Normalize your table(s). You have "atomic" fields [single value/single purpose] in your Table. You do calculations (Sums etc) in queries if and when you need the calculated values.

    So consider Table1 with fields f1, f2 , f3, f4, f5. To calculate the Sum for those fields in that record in that table
    MySum:Nz(f1,0) + Nz(f2,0) + Nz(f3,0) +Nz(f4,0) +Nz(f5,0)

    Relational database principles see http://forums.aspfree.com/attachment...2&d=1201055452
    More info on Nz at http://www.techonthenet.com/access/f...dvanced/nz.php

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

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2012, 07:39 AM
  2. Date Function as Field Name
    By Kirsti in forum Queries
    Replies: 7
    Last Post: 03-21-2012, 04:18 PM
  3. sum function counting field name I think...
    By sfgiantsdude in forum Access
    Replies: 16
    Last Post: 03-06-2012, 04:42 PM
  4. Function to Enable/Disable Field
    By swalsh84 in forum Programming
    Replies: 5
    Last Post: 11-04-2010, 02:48 PM
  5. Replies: 1
    Last Post: 06-23-2010, 09:45 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