Results 1 to 3 of 3
  1. #1
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129

    Update (Refresh) Calculated Field

    I have a subform which refers values to controls on a form on which I have a calculated field -
    originally I used CalculatedField Type then I changed it to txtBox with Number as Type
    Control Source =[field1]+[field2]+[field3] Now the calculated field does not show anything until all the controls have an entry. Sometimes (most times) not all will have entries. I put a form refresh on the main form but still no value. So then I did Me.Recalc on the AfterUpdate of the Main Forms Controls Then I did Me.DelTotal.Recalc And a refresh button in the subform, just nothing until all the controls in DelTotal Control Source hav an entry????
    Any clues anyone

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    I'll give you an analagy as to why it isnt working

    I'm going to give you three numbers to add together.

    1, 2

    Whats the answer? I hope you are thinking 'I can't tell you, you never gave me the third number' because thats exactly whats happening with access, it is waiting for the third number before it returns your answer.

    you need to do =nz([field1],0)+nz([field2],0)+nz([field3],0)

    The nz function checks to see if the item is null, and if it is, returns the number after the comma.

    See here for a bit more on nz

    http://office.microsoft.com/en-us/ac...001228890.aspx

  3. #3
    libraccess's Avatar
    libraccess is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Napier New Zealand
    Posts
    129
    Apologies for delay in getting back, away until today. It works, but of course you knew that

    Many thanks

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

Similar Threads

  1. ADO Update fails after Form Refresh
    By EddieN1 in forum Programming
    Replies: 4
    Last Post: 12-19-2011, 08:07 PM
  2. Update Query with a Calculated field
    By Lorlai in forum Queries
    Replies: 3
    Last Post: 09-21-2011, 10:57 AM
  3. update/refresh form
    By SlowPoke in forum Access
    Replies: 3
    Last Post: 09-20-2010, 09:21 AM
  4. Update/ Refresh Query
    By Vikki in forum Queries
    Replies: 0
    Last Post: 03-23-2010, 06:59 AM
  5. Update table from calculated field in a form
    By BernardKane in forum Forms
    Replies: 3
    Last Post: 11-28-2006, 09: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