Form Filter with more than one criteria (1 Viewer)

paulmcdonnell

Ready to Help
Local time
Today, 16:12
Joined
Apr 11, 2001
Messages
167
Hello guys,

Hope you're all well.

I need some help with a form filter I need the form to filter out those records with a STATUS that is "OVERDUE" and a date that is < date().

I've tried...

Me.Filter = "[Status]='Overdue' AND [deadline] < date()"
Me.FilterOn = True

type mismatch ....

I'm confused how the syntax works

does anyone know how the expression should be written.

Cheers
Paul
:)
 

RuralGuy

AWF VIP
Local time
Today, 09:12
Joined
Jul 2, 2005
Messages
13,825
I have a question. How did the [Status] field get set to "Overdue" unless you stored a calculation?
 

paulmcdonnell

Ready to Help
Local time
Today, 16:12
Joined
Apr 11, 2001
Messages
167
Status

HEllo...

The Status field is a STRING field.

VBA CODE changes the STATUS field to be whatever text string it needs to be at specific times throughout the use of the data base.

Depending on the how close the deadline date is the code updates the string field to be the appropriate warning, OVERDUE - PENDING - IMANENT - etc etc

Paul
;-)
 

RuralGuy

AWF VIP
Local time
Today, 09:12
Joined
Jul 2, 2005
Messages
13,825
Hi Paul,
I think you would have better success if you calculate [Status] each time you need it rather than letting some code somewhere do it for you. What you are doing falls under the "storing a calculation" category and can lead to problem. As for the type mismatch, I suspect your [DeadLine] field is not a DateTime field. You could use CDate([DeadLine]) < Date() and it will probably work.
 

Users who are viewing this thread

Top Bottom