Results 1 to 2 of 2
  1. #1
    PicoTTS is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2016
    Posts
    29

    Calculated Field: Different between 2 Fields with same Name on Different Tables

    Hi,



    I am trying to create a calculated field in a query. I am having problems setting the criteria. I have ORDNUM

    I have a field called "ORDNUM" on 2 tables. One table is called [Orders] and the other is a query called [Sales]

    The formula I am using:

    Quantity: DLookUp("Quantity","[Orders]","[Orders]![ORDNUM] = '" & [ORDNUM] & "'")

    Basically I want DSum function to add the quantity field from the Orders table when the ORDNUM field from another table matches the ORDNUM on my current query.

    I hope i explained this properly.

    Thanks for the help.

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    is ORDNUM numeric? if so then you need to remove the single quotes

    But why not just join the two tables together?

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

Similar Threads

  1. Calling tables within a calculated field
    By TonyB in forum Reports
    Replies: 4
    Last Post: 09-06-2013, 03:54 AM
  2. Calculated Fields in tables
    By dharsh in forum Misc
    Replies: 12
    Last Post: 07-01-2013, 03:07 PM
  3. Calculated field, data from multiple tables
    By Suzie2012 in forum Programming
    Replies: 7
    Last Post: 06-12-2012, 01:15 PM
  4. Calculated fields across tables and forms
    By drrob1983 in forum Queries
    Replies: 4
    Last Post: 09-15-2011, 09:41 AM
  5. Replies: 6
    Last Post: 06-08-2011, 05:00 PM

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