Results 1 to 4 of 4
  1. #1
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192

    DLookup Help

    Hi everybody,


    This is in continuation of an earlier post, which I closed solved after getting a solution from Weekend00. However, now I face another problem.
    The 1st Shift Hank run is erroneous when data for multiple Frames are entered.
    SQL for Query ‘SpinningFramesHanksRun’ is as follows:


    SELECT tblHankMeterReading.*, tblDateWorked.DateWorked, ([1stShiftReading]-DLookUp("[3rdShiftReading]","SpinningFramesHanksRun","[DateWorked]=#" & DMax("[DateWorked]","SpinningFramesHanksRun","[DateWorked]<#" & [DateWorked] & "#") & "#")) AS 1stShiftHankRun, ([2ndShiftReading]-[1stShiftReading]) AS 2ndShiftHankRun, ([3rdShiftReading]-[2ndShiftReading]) AS 3rdShiftHankRun, tblSpinningFrames.frameMake
    FROM tblSpinningFrames INNER JOIN (tblDateWorked INNER JOIN tblHankMeterReading ON tblDateWorked.DayWorkedID = tblHankMeterReading.shiftDay) ON tblSpinningFrames.frameID = tblHankMeterReading.frameID;


    Is it possible to include frameID field in the DLookup Criteria?
    With thanks,
    Alex

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure; this good reference on the syntax includes a multiple criteria example at the bottom:

    DLookup Usage Samples
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192
    Thank u pbaldy. The usage samples solved my problem.
    Alex

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Alex.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. DLookup example
    By pkstormy in forum Code Repository
    Replies: 1
    Last Post: 07-16-2012, 09:52 AM
  2. dlookup help
    By gsantacruz in forum Programming
    Replies: 9
    Last Post: 10-11-2010, 11:46 AM
  3. DLookup()
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 07:20 AM
  4. Need help with dlookup.
    By Keith in forum Database Design
    Replies: 8
    Last Post: 05-24-2010, 06:28 PM
  5. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 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