Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Filter Issue 1

Status
Not open for further replies.

heatherci

Technical User
Feb 23, 2008
12
US
Hi, I am applying a docmd.applyfilter command onclick to a form cmdbutton. I have used the code many times before but cannot figure out why it will not filter. This form does contain many one-to-one subforms the others have not.

The code is
docmd.applyfilter , "[DueDate]= 'date()'"
to grab the forms due today only and another one is the same except it is
docmd.applyfilter , "[Serviced]= '-1'"
to grab all the forms where the Serviced field is checked.

I can't understand why this code worked on another form but not this one. Is it because of the subforms or am I misplacing quotes on this?

Thanks for any assistance.
 
Should it be

docmd.applyfilter , "[DueDate]= #" & date() & "#"

and

docmd.applyfilter , "[Serviced]= -1"

assuming DueDate is a date time type and SErviced is a boolean, or integer type


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top