ApplyFilter on Report

  • Thread starter Thread starter יריב החביב
  • Start date 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 ?
 
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"
 
Back
Top