Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    31

    Unanswered: Field Calculation problem!

    I have the following code:

    A+B+C
    where A=1
    B=2
    C=3
    The result should be "6", but instead I get "123" on my output field! what is going on?
    Thank you

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You're adding them as strings instead of numbers.

    "1" + "2" + "3" = 123
    1 + 2 + 3 = 6
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Dim a As Integer
    a = CInt(strA)
    Last edited by r123456; 06-30-04 at 01:38.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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