Results 1 to 4 of 4

Thread: DLookup

  1. #1
    Join Date
    Oct 2007
    Posts
    17

    Unanswered: DLookup

    Okay So I believe I do understand it and I'm trying to utilize it but I'm running into a problem with it. I have created a Repair Log for all the PCs in my facility. I have a table for both Desktops and Laptops. Then I have a repair table. Each one of these tables has a form associated to it so you can add desktops into the desktop table or add repairs into the repair log table. What i'm attempting to do is whenever I lookup a desktop in the desktop form I want the last repair date to pop up in the corner from the repair log table. I've tried using a dlookup to pull the repair date from the repair table when the repair name = desktop name but didn't have luck. Can someone steer me in the right direction? I would greatly appreciate it.

    This is the first database i've built ;(

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Please post your dlookup statement.

    Can there be more than 1 repair record per computer?

  3. #3
    Join Date
    Oct 2007
    Posts
    17
    =dlookup( "[tblRepair]![Repair Date]","tblRepair", " [tblRepair]![Name]= [tblGlaciers]![Name] ")

    Yes there can be however I don't know how to restrict it to the most current or "Last Repair"

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    you need to replace [tblGlaciers]![Name] with the form name that you are calling the function from and the and control that holds the Name field.

    Rather than using [tblRepair]![Name], create a goup by query using tblRepair and the Name and RepairDate fields and use that. Group by Name and use Max for the RepairDate.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •