Results 1 to 7 of 7
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    Value add onto itself - bizarre it one instance it didn’t do it

    I have a codes with a formula that a variable would add on to itself along with another variable. It most cases it works like a charm.

    However it was very bizarre that it didn’t work in one instance and I can’t fingure our why.

    Example of the formula is

    totval = totval + varA

    varA keeps changing as we go through the loop.

    In the end it gives wrong number aggregation and right now, I don’t have a way to go around or fix it.

    However if you use at the end for the one that doesn’t add on,

    app = totval + varA

    app would have the correct total.



    However if you have it like

    totval = app it doesn’t add the last value.

    Please advise !
    Last edited by johnseito; 04-03-2018 at 01:16 PM.

  2. #2
    Join Date
    Apr 2017
    Posts
    1,673
    What datatypes are totval and app (integer, bigint, double)?

  3. #3
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    totval is integer, app I didn’t set a data type.

  4. #4
    Join Date
    Apr 2017
    Posts
    1,673
    Quote Originally Posted by johnseito View Post
    totval is integer, app I didn’t set a data type.
    The max value for integer in Access is 32767 - was this limit reached or not?

  5. #5
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Yes it was, thank you for pointing it out. You are absolutely correct. It went over by about 3k. I change the data type to double and it work.

  6. #6
    Join Date
    Apr 2017
    Posts
    1,673
    Use Long Integer (from –2,147,483,648 to 2,147,483,647)

  7. #7
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    using Long as integer, that's for the valuable information.

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

Similar Threads

  1. Replies: 6
    Last Post: 03-17-2018, 06:24 PM
  2. Didn't know how to search this one first...
    By Voodeux2014 in forum Access
    Replies: 3
    Last Post: 03-03-2015, 03:48 PM
  3. Replies: 5
    Last Post: 10-11-2013, 07:29 AM
  4. Absolutely bizarre query issue
    By MWhitfield in forum Access
    Replies: 3
    Last Post: 06-10-2010, 08:20 PM
  5. Query decided it didn't want to be updateable anymore
    By tylerthompson in forum Queries
    Replies: 0
    Last Post: 07-23-2009, 09:43 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