Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Boise, Idaho, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'Overflow' (2000)

    I'm getting an "overflow" error message when entering only larger numbers. I've changed the field from integer to long integer but to no avail.
    I can enter smaller quantities (in the 100s -) and smaller dollar amounts (in the 1000s) but when the quantity or dollar gets too large (and I have not idea what "too large" is) then I get the overflow message.

    for example, I can't put in 2 @ 37,900 each.

    any idea what's causing this and what I can do to stop it? The deadline for this data is past and 'they' are getting annoyed with me...

    help!@!@

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 'Overflow' (2000)

    An integer can contain numbers up to 32,767.
    A Long Integer can contain numbers up to more than 2 billion.

    The 37,900 you mention is relatively close to the upper limit for Integers. Are you sure that you have changed ALL relevant fields? Besides, if you're dealing with dollar amounts, why not use the Currency data type? That can contain really humongous amounts.

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Boise, Idaho, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Overflow' (2000)

    Hans

    Thanks for your response...

    The only field that is integer is the quantity in stock which never goes over 100. I originally had the quantity and cost set to currency but thought maybe that was the problem so I changed them both to long integer... and I've double checked. They are currently at long integer.

    any other ideas?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 'Overflow' (2000)

    <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29> You state "The only field that is integer is the quantity" and "They are currently at long integer". Which of the two?

  5. #5
    Star Lounger
    Join Date
    Apr 2002
    Location
    Boise, Idaho, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Overflow' (2000)

    Sorry - I have 3 fields: quantity in stock, quantity requested and cost.
    I didn't give you the entire name - the integer is the quantity in STOCK..
    the other 2 (requested and cost) are the ones I changed and the only ones used in the calculation of total cost.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 'Overflow' (2000)

    Sorry, I don't really have an idea what causes this. Do you use an expression =[Quantity Requested]*[Cost] to calculate total cost, or do you have code to calculate the total cost?

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: 'Overflow' (2000)

    Hi Deb
    Are you doing this via a form or a query?

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: 'Overflow' (2000)

    <hr>for example, I can't put in 2 @ 37,900 each<hr>
    What does this mean? If you meant that you can't put 37900 in two fields, that is one issue. If you meant that you tried to type in "2 @ 37,900 each", that is a diferent problem. You certainly can't put text into a Long datatype without getting an overflow error, and that includes the comma in the number, although that usually kicks back a message about the separator.
    Charlotte

  9. #9
    Star Lounger
    Join Date
    Apr 2002
    Location
    Boise, Idaho, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Overflow' (2000)

    Ya know, when I write these I understand completely what I'm trying to say. I realize after reading my own words how vague it sounds.. I will try to be more specific in the future. What I have is 3 fields. One field contains the quantity currently in stock and is set at integer. A second field is the quantity requested, currently set at long integer. The last field is the expected cost of the item requested and is also set to long integer. When the form is opened, my fields are unbound. I can put any numeric value in any of those fields. When I click on "Save" then the information I entered is put into my table. It is at that point that I get the 'overflow' message. If my item cost is under 33,000 (exact threshold is unknown) the information is stored with no problem. If my item cost is 33,000 or more then I get the 'overflow' message. I have triple and quadruple checked my table fields - they are really set at long integer. I do not input the thousands separator (the comma). I only put in the number.

    I hope that made it clearer.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 'Overflow' (2000)

    There <big><font color=red>MUST</font color=red></big> be something defined as integer, either in your tables, or in the code behind the Save button. The 33,000 is too close to the upper bound of 32,767 for Integers to be coincidence. Since you have checked the fields thoroughly, can you post the code behind the Save button?

  11. #11
    Star Lounger
    Join Date
    Apr 2002
    Location
    Boise, Idaho, USA
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'Overflow' (2000)

    TA-DAH!!!! <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    (and boy do I feel stupid...) <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

    The temporary field I defined in code is defined as an integer rather than long....

    I never even thought to check that - until you requested the code behind the form...

    I just knew I was missing something simple and since I've never had this problem before I didn't even think about checking my variables.

    Thank you SO MUCH (everyone who responded)

    I have learned a valuable lesson (or two) and maybe some other person new to coding will have learned something as well.

    I'm sorry for having taken so much of your time, but you just can't imagine the relief I feel...


    <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •