Results 1 to 6 of 6
  1. #1
    pratim09 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    30

    Need to autocalculate the total field

    I have a form in which I have 4 fields A,B,C,D and a total field Total.
    The fields takes integer values .All the fields are optional .I want the total field to autopopulate with the values i enter in these fields .I can give all values,no values,1 ,2 or 3 values. .Plz suggest

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,175
    In the totals field, try the following calculation control source :

    =Nz([Fieldname1])+Nz([Fieldname2])+Nz([Fieldname3])+Nz([Fieldname4])

    grNG

  3. #3
    pratim09 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    30
    This is appending the fields in the total not adding them .plz suggest

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,175
    If the numbers are concatenated, Access looks at them as textes. So you have to convert them explicit to numbers, use CInt to convert them to integers or CDbl if you have decimals. Example:

    =Cint(Nz([Fieldname1]))+Cint(Nz([Fieldname2]))+Cint(Nz([Fieldname3]))+Cint(Nz([Fieldname4]))

  5. #5
    pratim09 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2011
    Posts
    30
    thanks a ton its working now

  6. #6
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,175
    OK, will mark this as solved

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

Similar Threads

  1. Divide two Fields, Total in another field
    By prawln in forum Access
    Replies: 1
    Last Post: 03-28-2011, 06:45 PM
  2. Grand Total Field ???
    By damo1995 in forum Forms
    Replies: 6
    Last Post: 02-10-2011, 02:43 PM
  3. Grand total of field on a subreport
    By degras in forum Reports
    Replies: 9
    Last Post: 02-03-2011, 12:09 PM
  4. Total field with access
    By rev_ollie in forum Queries
    Replies: 0
    Last Post: 04-27-2010, 08:54 AM
  5. Creating field based an another field's total
    By yashysmashy in forum Queries
    Replies: 0
    Last Post: 09-02-2009, 03:48 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