Results 1 to 3 of 3

Thread: DLookup problem

  1. #1
    Join Date
    Jun 2007

    Question Unanswered: DLookup problem

    In my db I have one team that enters work requests on a form that are then completed by anther team. When the work item is put into the db I am writing a timestamp into a Date/Time field in the table by using the Now function, (strTimeStamp = Now). When the second team changes the status to complete on another form I write another timestamp into the table, in another field.

    Obviously to calculate the time difference between the to times I need to retrieve the values from the correct row of the table. I have an AutoNumber field that I am attempting to use to retrieve the data from the correct row. I am using Dlookup to do this. In my testing, the Date/Time retrieved is ALWAYS the first row of the table. Even though I am (for testing purposes) trying to retrieve the data where the Authonumber field is 59. See code sample below

    Dim ID As String, strTFT as Date
    ID = 59
    strTFT = DLookup("[Submitted]", "[Feedback]", [ID] = ID)
    For some reason the data is retireved from the first row instead of row 59.

    Any Ideas?

  2. #2
    Join Date
    Jun 2007

    Red face Solved

    OK, so I have been staring at this too long today...

    I found my error
    strTFT = DLookup("[Submitted]", "[Feedback]", [ID] = ID)


    strTFT = DLookup("[Submitted]", "[Feedback]", "[ID] =" & ID)

  3. #3
    Join Date
    Dec 2002
    Préverenges, Switzerland
    DELETED - you found it

    currently using SS 2008R2

Posting Permissions

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