Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    361

    Unanswered: Sum shows error after $40,000

    I have 8 text boxes on a form that are being added together. When the amount of those text boxes gets over 33,000 it shows a error. Is there a limit on the value of a text box? I can't imagine there is but then again I wouldn't be asking this question if I knew that answer. Thanks.

  2. #2
    Join Date
    May 2004
    Posts
    21
    Your data type for the values may be limiting the storage of the value. For example, an integer data type can only store numbers between -32,767 and 32,767. That sounds like the problem to me. If decimals aren't a problem, you should probably switch to long integer data type.

  3. #3
    Join Date
    Mar 2004
    Posts
    361
    I changed the data type to long interger and decimal places to 0. I am still getting that error. You were right when you said that the value of 32768 wouldn't work. That's were it craps out. Is there anyother data type I should try?

  4. #4
    Join Date
    May 2004
    Posts
    21
    Well, if you are trying to store decimal values, long integer won't work because it can't handle them. If your decimals take up 7 places or less, use the single data type. If they are more than 7, use the double data type. Other than that, I'm not sure what else could cause such an error off-hand.

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740

    a text box doesn't have a data-type.

    is this box bound to something in a table?

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Mar 2004
    Posts
    361
    I changed the data type in the table. The column name is Resid_Contract and in the design mode of the table it says long integer and its a currency. I use that source for the text box from the query that is tied to the form. The user types in a value which will be larger than 32767 but won't have more than two decimal places.

  7. #7
    Join Date
    Mar 2004
    Posts
    361
    Found my prob. I had CInt before that value in the query. Thanks.

  8. #8
    Join Date
    May 2004
    Posts
    21
    I'm confused. I don't think you can use both currency and long integer in a column at the same time. However, from what I'm reading about your data, I would use single or currency as my data type in this instance. The difference between single and currency is that single uses 7 decimal place floating-point calculations and currency uses 4 decimal place fixed-point calculations.

  9. #9
    Join Date
    May 2004
    Posts
    21
    Nevermind. Glad it's working.

  10. #10
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    tjarvas: good it's fixed
    scoot241: currency is a scaled long, not a float (storage is smaller, manipulations are faster, and confusion is easier)


    izy
    currently using SS 2008R2

Posting Permissions

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