Dlookup Date problem

A

adriany

txtbox2 = DLookup("[field1]", "table1", "[field2]= '" &
[field2] & "'")

when field1 is text this code works fine
when field1 is date is not working at all.

can anyone help me with this one
 
G

Gerald Stanley

Try
txtbox2 = DLookup("[field1]", "table1", "[field2]= #" &
Format([field2], 'mm/dd/yy') & "#")

Hope This Helps
Gerald Stanley MCSD
 

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

Top