[AccessD] Dlookup syntax

Arthur Fuller artful at rogers.com
Wed Jul 21 12:03:17 CDT 2004


Thanks for the tips. What really puzzles me is that no matter what
values I supply, the first call works and the second call fails.
Bizarre! I'm still investigating.

Arthur

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, July 21, 2004 4:57 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Dlookup syntax


Hi Arthur

The syntax is OK.
The expression, however, must contain the usual US formatted
date(time) string:

  strDate = Format(d, "mm\/dd\/yyyy")

Then:

  X = Dlookup("myColumn", "myTable", "myDateColumn=#" & strDate & "#")

And, as Charlotte points out, always take care of a possible Null return
from DLookup().

/gustav


> I can't remember how to format this! Bloddy L. The second thing to go 
> is memory. I forget what the first is.

> Dim s as string
> Dim x as Integer
> Dim d as Date

> d = Date()
> X = Dlookup("myColumn", "myTable", "myDateColumn=#" & d & "#")

> Doesn't seem to work. What should I be doing instead?

> TIA,
> Arthur

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list