ApplyFilter on Report

  • Thread starter יריב החביב
  • Start date
×

יריב החביב

Hello,

i am trying the above and get error massege

"the ApplyFilter action or method can be caried out only from

an open macro or open eventprocedure"

i tried also to filter with macro and it didnot work.

Can you help ?

thank's
 
×

יריב החביב

docmd.openreport . . . .
docmd. apply filter . . .

what is this Open event ?
 
R

Rick Brandt

docmd.openreport . . . .
docmd. apply filter . . .

what is this Open event ?

It's an event of the report. That is where you need to apply your filter
if you want to use DoCmd.ApplyFilter. Better yet is don't use
DoCmd.ApplyFilter at all as that appears to only be useful for forms.

DoCmd.OpenReport already has an argument that you can put a WHERE clause
in. Use that instead.

DoCmd.OpenReport "ReportName",,,,"WHERE clause goes here"
 
×

יריב החביב

THANK YOU
--
תודה רבה


Rick Brandt said:
It's an event of the report. That is where you need to apply your filter
if you want to use DoCmd.ApplyFilter. Better yet is don't use
DoCmd.ApplyFilter at all as that appears to only be useful for forms.

DoCmd.OpenReport already has an argument that you can put a WHERE clause
in. Use that instead.

DoCmd.OpenReport "ReportName",,,,"WHERE clause goes here"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top