Results 1 to 4 of 4
  1. #1
    bytreeide is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    47

    1 + 1 + 1 = 111 not 3? Trouble with math and expression builder

    if for instance I have the following Names of text boxes:



    Text001
    Text002
    Text003

    And lets say that each of these currently have a value of 1.

    I have written a mathematical operation in Control Source for a fourth text box that looks like this:

    = [Text001] + [Text002] + [Text003]

    What I am getting is:

    111

    I was expecting:

    3

    If I were to change Text002 to equal 2 the the result of the equation would be:

    121

    My thought is that I have done something wrong with the expression builder.

    Suggestions?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    it is interpreting them as text. try
    = val([Text001]) + val([Text002]) + val([Text003])

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    + is valid concatenation character (holdover from ancient BASIC).

    The first 3 calcs result in text strings.

    At least one of the terms in the 4th calc must be a number to force arithmetic instead of concatenation.

    So as ranman points out, convert to number.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    bytreeide is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    47
    Thank you so much.

    I figured that there was something that I wasn't getting. I even checked to make sure that each of the Control's Format was "General Number" didn't seem to help.

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

Similar Threads

  1. expression builder
    By frustratedwithaccess in forum Access
    Replies: 7
    Last Post: 11-12-2014, 09:15 AM
  2. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  3. Expression builder help
    By jigg14 in forum Forms
    Replies: 1
    Last Post: 03-19-2012, 09:47 AM
  4. Expression Builder not there
    By schnuber in forum Access
    Replies: 1
    Last Post: 02-17-2012, 01:17 AM
  5. Expression builder
    By PJ_d_DJ in forum Access
    Replies: 2
    Last Post: 02-24-2011, 03:38 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