Consulting

Results 1 to 2 of 2

Thread: Solved: DLookup help needed

  1. #1
    VBAX Regular
    Joined
    May 2007
    Posts
    86
    Location

    Solved: DLookup help needed

    Dlookup,

    Why is it that I can get a result from:

    [vba]
    stg2 = DLookup("DOORCODE", "DoorDesign", "DOORDESCRIPTION='Two Central Window Single'")
    msgbox(stg2)
    [/vba]

    but not from:

    [vba]
    stg1 = "Two Central Window Single"
    MsgBox (stg1)
    stg2 = DLookup("DOORCODE", "DoorDesign", "DOORDESCRIPTION=" & stg1)
    [/vba]

    I don't understand how it is different!!!!!

    Can someone please help with Dlookup

    Thanks,

    -Andy.

  2. #2
    VBAX Regular
    Joined
    May 2007
    Posts
    86
    Location
    [vba]
    stg2 = DLookup("DOORCODE", "DoorDesign", "DOORDESCRIPTION= '" & Me.door_type & "'")
    [/vba]

    After my head exploded from adapting to Access from Excel, I found that I had multiple personalities that posted the solutions on the same websites that I'd asked the question on.

    I'm off to China.

    I wish I'd realised I had an extra "'" at the start of one of the variables before, I've wasted my opportunity to finish this project.

    Thanks Mr. Tur, I had adapted another of your posts to solve this one.

    -Andy.

Posting Permissions

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