Date Filter Problem

  • Thread starter Thread starter Juan Carlos
  • Start date Start date
J

Juan Carlos

I have problem I have a function:

A=dsum("[Contador]", "Cuentas", "[Fecha] <= #" & FechaForm
& "#")

And the sum result a error, the result is the sum the all
the records, it happen such the filter do not exist.

Someone can help me.

Thanks in advance.

Juan Carlos
 
Juan,

It is probably being confused by FechaForm. you need to
refer to the actual field name on the form. If the field on
the form is Fecha and your form name is FechaForm you need
to refer to it as either...

From FechaForm
Me!Fecha

A=dsum("[Contador]", "Cuentas", "[Fecha] <= #" & Me!Fecha &
"#")


From somewhere else...
Forms!FechaForm!Fecha
A=dsum("[Contador]", "Cuentas", "[Fecha] <= #" &
Me!FechaForm!Fecha & "#")

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
What is FechaForm? If it is a text box where users enter a date, set its
Format property to Short Date or similar so Access knows it is a date.

If your date format is different from the American one, be sure to format
the date into the 3rd string like this:
A = DSum("[Contador]", "Cuentas", "[Fecha] <= #" & _
Format(Me.FechaForm, "mm\/dd\/yyyy") & "#")
More information on that in:
Intenational Dates in Access
at:
http://members.iinet.net.au/~allenbrowne/ser-36.html
 
Back
Top