PDA

View Full Version : Solved: DLookup help needed



andysuth
09-17-2008, 10:08 AM
Dlookup,

Why is it that I can get a result from:


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


but not from:


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


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

Can someone please help with Dlookup

Thanks,

-Andy.

andysuth
09-17-2008, 10:16 AM
stg2 = DLookup("DOORCODE", "DoorDesign", "DOORDESCRIPTION= '" & Me.door_type & "'")


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.