jamaarneen
Programmer
Hi
I have a simple DLookup function to retrieve data from one field, based on a 'date' in another field.
it's almost working fine, but there is a problem: the function is swapping two dates: for the date 9/5/2009 (which means 9 May), he returns the value for 5/9/2009 (= 5/Sep).
In the table's design view, I have set the field to type 'date', format 19/6/2001 (Short Date).
there got to be some code to prevent VBA from being confused. I just don't know how.
this is my criteria part in the function:
when I tried this:
the function returned nothing (null)
(In addition, there are some records that he don't returns anything (=null). I hope to figure that one out later)
Thanks in advance
Ja - using MS 2003
I have a simple DLookup function to retrieve data from one field, based on a 'date' in another field.
it's almost working fine, but there is a problem: the function is swapping two dates: for the date 9/5/2009 (which means 9 May), he returns the value for 5/9/2009 (= 5/Sep).
In the table's design view, I have set the field to type 'date', format 19/6/2001 (Short Date).
there got to be some code to prevent VBA from being confused. I just don't know how.
this is my criteria part in the function:
Code:
"datparDate = #" & dDate & "#"
when I tried this:
Code:
"datparDate = #" & Format(dDate, "d mm yyy" & "#")
(In addition, there are some records that he don't returns anything (=null). I hope to figure that one out later)
Thanks in advance
Ja - using MS 2003