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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup advice 1

Status
Not open for further replies.

tigersden

Technical User
Apr 16, 2003
81
GB
Hi,
When trying this DLookup a null is always returned. I know both of the criterias have been met. If I split the criteria ie. only use 1 then I get a value returned, but with both nothing. I have also tried enclosing the date with #'s but it still will not return a value.
Any ideas??

Me.txtAssessorRef = DLookup("AssessorRef", "tblReview", "[RiskRef] = " & Me.txtRiskRef & " And [ReviewDT] = " & ReviewDt)
 
You may try this (provided ReviewDt is a real DateTime) :
& " And ReviewDT=#" & Format(ReviewDt, "yyyy-mm-dd") & "#")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,
Thanks for that. I have been looking at it for ages & totally forgot about date formats!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top