Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with DLookup

Status
Not open for further replies.

brimile

Technical User
Oct 2, 2003
5
US
Hi all - this is my first post, but I have read many, many threads previously so thanks in advance.

I'm trying to set a variable called moDate to the value found in a table using the dlookup method.

I have declared moDate as a string and assigned the value using:
moDate = DLookup("[MP]", "tbl_LastRun", "[ProjectType] = '" & datatbl & "'")

The result is "", but when I break the code and type
?DLookup("[MP]", "tbl_LastRun", "[ProjectType] = '" & datatbl & "'") in the immediate window I get a result of DLYPOD.

Why isn't modate getting this value?

Cheers

brimile
 
When you set a BreakPoint in your code has datatbl the expected value ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
yes. the response I get is what I expect. That's what makes this so frustrating - it seems easy enough.
 
Is it possible to get a VbCrLf or something with the DLookup result - something that might prevent it from assigning a string value?

 
just figured it out . . . I made an error in a select case statement above this code so the dlookup function wasn't even running.

What a goofball!!

Thanks PHV, your post helped me to rethink the obvious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top