Access Report filter and whereCondition

powerz

New member
Local time
Yesterday, 23:57
Joined
May 19, 2006
Messages
4
Hi, When I open a report, I want to use the filter in current Form. Code like:

If me.flterOn then
strFilter=Me.Filter
end if
Docmd.OpenReport myReport,acPreview,strFilter

The report displays all record regardless my fileter. Any idea?
Thanks.
 
Put this line before the OpenReport command to show your filter:

Msgbox strFilter

You will see if you have the correct filter.
 
I changed it to
Docmd.OpenReport myReport,acPreview,,strFilter
and work. not sure why?
 

Users who are viewing this thread

Back
Top Bottom