Results 1 to 6 of 6
  1. #1
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60

    DLookup Query

    When I create a DLookup it shows the correct answer, but if the data is amended in the main table (eg haulage rate) it updates the DLookup answer.

    Is there a way you can do a DLookup but not have the answer linked to the table?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    No. That's what domain aggregate functions are for, to summarize data in table. What do you mean by amended - new record or edit existing record or both?
    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.

  3. #3
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60
    I have a table containing current haulage rates, so these are amended when we have had an increase. Within the order form I select a haulier & would like it to show the current rate - though if the rates were increased I would not want the field to update.

    Hope that makes sense!

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    No it doesn't. I'm guessing that what you really want to do is have rates that apply to a specific date range. If that's the case your rates table may have to change to include a start date/end date so that you can dlookup by a specific date.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Your options are to:

    1. have a single record for each halier in rates table and save the haulage rate with every order record so that when the rate changes, the existing order records are not changed

    2. have multiple records for each hailer's rates and save record ID or as rpeare suggested, include date range fields and use them as additional criteria in the DLookup

    I recommend avoiding domain aggregates in queries and on forms/reports whenever possible. They can be slow.
    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.

  6. #6
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60
    Thank you June7

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

Similar Threads

  1. Dlookup in query
    By Bertrand82 in forum Queries
    Replies: 9
    Last Post: 11-14-2012, 06:42 AM
  2. DLOOKUP two tables in query
    By sockswithsandals in forum Queries
    Replies: 3
    Last Post: 04-17-2012, 06:55 AM
  3. DLookup in Query
    By mfrey40 in forum Queries
    Replies: 3
    Last Post: 12-27-2011, 12:41 AM
  4. Query with Dlookup
    By mari_hitz in forum Queries
    Replies: 5
    Last Post: 10-14-2011, 09:22 PM
  5. Query Dlookup different fields
    By newwales in forum Access
    Replies: 1
    Last Post: 07-07-2011, 10:13 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