DLookup's criteria

G

Guest

Hello!

I'm trying to use DLookup to return a date if it falls within a certain
range and so far it doesn't work. Can someone please tell me what's wrong?

Here's my code:
txtNewDate = DLookup("[Date]", "tbQOL", "[PatientID]='" & TheID & "' AND
[Date] >= " & DateMin & " AND [Date] <= " & DateMax)

It seems to output a value if I take out one of the Date criteria but it
doesn't work when I have to compare it against both DateMin and DateMax.

Thanks in advance.
 
G

Guest

I think I just solved my own problem. I needed "#" symbols on either side of
the DateMin and DateMax.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top