Dlookup Date

T

TarrynG

Hi

New to Dlookup function, please help:

I am looking up a value from a query where the criteria is a particular
date. ie. =Dlookup(<expr>,<domain>,Date = 28/02/2002).

How do I get this to work without having to type in the number for the date
being looked up (37315 in this case)?

Many thanks
 
T

tina

How do I get this to work without having to type in the number for the
date
being looked up (37315 in this case)?

don't know what you mean by that, but...
in your example "Date" must be the name of a field in your domain (though if
you have a table with a field named Date, you should change it. Date is a
Reserved Word in Access, and reserved words should never be used as a name
for anything in the database). if the Date field is data type Date/Time, to
find a date value you would write the criteria expression as

=Dlookup(<expr>,<domain>,"Date = #28/02/2002#")

hth
 
G

Guest

Enter the date in a text box on your form.
DLookup("[field]","table", "[field] ='" & Me!txtdate & "'")
 
T

TarrynG

Thanks for the solution and advice

tina said:
don't know what you mean by that, but...
in your example "Date" must be the name of a field in your domain (though if
you have a table with a field named Date, you should change it. Date is a
Reserved Word in Access, and reserved words should never be used as a name
for anything in the database). if the Date field is data type Date/Time, to
find a date value you would write the criteria expression as

=Dlookup(<expr>,<domain>,"Date = #28/02/2002#")

hth
 
Top