Results 1 to 5 of 5
  1. #1
    Troubled is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2015
    Location
    Cambodia
    Posts
    9

    Smile Adding two fields together and putting results in a third field


    I am an utter beginner using Access 2003. I have easily created a database but cannot make it do simple tasks. One task is to add two fields and put the result in a third field. It should be a terribly simple thing to do but seems to involve queries and macros and combo boxes etc. All the forums I have looked at provide no help because the instructions contain syntax errors and incomplete instructions. Please could anyone help me

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in a query,
    MyNewTxtField: [field1] & [field2]

    MyNewValue: [field1] + [field2]

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Since this is a Calculated Field, it should not be stored in a Table, but simply re-calculated , as needed. Since you're not storing it, you can use the Control Source of the third Textbox to do the math.

    In Form Design View

    • Right-Click on the 'results' Textbox
    • Click on Properties
    • Click on the Data Tab
    • In the Control Source Property enter this: = Nz([Textbox1],0) + Nz([Textbox2],0)

    Of course you'll have to replace Textbox1 and Textbox2 with your actual names of your Textboxes.

    The above assumes that when you said 'add two fields' you actually meant 'add,' in the mathematical sense. If you meant 'add two fields' as in adding ABC to DEF and getting ABCDEF, the Control Source would be slightly different:

    =[Textbox1] & [Textbox2]

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Troubled is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    May 2015
    Location
    Cambodia
    Posts
    9
    Thank you so much. That's perfect and just what I wanted. I really do appreciate your help.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Glad we could help!

    Welcome to AFN!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Adding date field ignores count fields?
    By missypooh1969 in forum Queries
    Replies: 7
    Last Post: 08-14-2014, 12:45 PM
  2. Replies: 6
    Last Post: 02-11-2014, 05:20 AM
  3. Replies: 5
    Last Post: 02-08-2013, 11:28 AM
  4. Replies: 1
    Last Post: 09-15-2011, 08:45 AM
  5. Putting an Expression in a Field Box
    By MWB in forum Queries
    Replies: 4
    Last Post: 11-02-2010, 06:58 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