Results 1 to 4 of 4
  1. #1
    Mony is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    3

    calculation fields by using lookup expression

    Hi there, here is my situation ..

    Table 1:

    Customer ID Customer Commission1 Commission 2 Commission 3 Silver Gold Diamond
    1 ...................Mony ........ 10 ........... 20 ..................... 30 ...........?.........?.........?


    Table 2: (lookup)

    Rate Product 1 Product 2 product 3

    Silver . 2 ........... 3 ......... 4
    Gold ...5............ 6 .......... 7
    Diamond 8 .........9 ......... 10

    my question is: Can I set up a lookup by using table 2 to calculate table 1 silver, gold, and diamond

    For example: I want to know Mony's commission1 on silver, gold, and diamond ...



    It would be: silver = 10 *2 gold= 10*5 diamond= 10*8


    I know I can do the calculation in the query.. but the point is the rate will keep change/add .. I don't really want keep going to the design field to change or add the rate.. it makes easy just change or add the rate in the table 2.

    is that possible?

    I appreciate if you can tell me how or you have a better idea to help me out here


    Mony
    Last edited by Mony; 04-03-2015 at 04:10 PM. Reason: make it clear

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You should research Normalization and Table design.
    When you see fields with Names such as Customer1, Customer2,... CustomerX and
    Product1, product2.... It's a sign that the tables are probably NOT Normalized.
    You should learn the concepts involved in Table design before trying to create a database.
    see http://holowczak.com/database-normalization/
    http://www.phlonx.com/resources/nf3/

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    As orange says, this is not a normalized data structure. Will cause lots of frustration.

    However, try:

    DLookup("Product1", "Table2", "Rate='Silver'")
    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
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The table structure you have is called "Committing Spreadsheet".
    Spreadsheets are short and wide.
    Access tables are tall and narrow.


    set up a lookup by using table
    I never use look up fields (different than look up tables)
    See http://access.mvps.org/access/lookupfields.htm


    but the point is the rate will keep change/add
    Then the rate should be stored in a table.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-24-2014, 02:54 PM
  2. Replies: 1
    Last Post: 12-04-2014, 01:43 AM
  3. SQL expression to perform a calculation
    By springboardjg in forum Queries
    Replies: 1
    Last Post: 05-20-2011, 06:57 AM
  4. lookup value for report calculation
    By josbor01 in forum Reports
    Replies: 0
    Last Post: 03-02-2010, 01:41 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