469,277 Members | 1,959 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

can't filter report in Access2000

hi everyone.
I have this code to apply the filter on a form to a report.
In Access97 it worked fine but when I converted it to Access2000 the
report shows all records in the table. What has happened?

this is the code:
strGlobalFilter is a global valiable
if me.filter = "" then
MsgBox "Apply a filter to the form first."
Else
strGlobalFilter = me.filter
DoCmd.OpenReport "rptLeads", acViewPreview
End If
in the report's "OnOpen" event:
DoCmd.ApplyFilter, strGlobalFilter

It shows now all the records
Thanks för any help
/Regards BigOlle

Feb 7 '06 #1
2 1264
Gox
ol**@ylm.se wrote:
hi everyone.
I have this code to apply the filter on a form to a report.
In Access97 it worked fine but when I converted it to Access2000 the
report shows all records in the table. What has happened?

this is the code:
strGlobalFilter is a global valiable
if me.filter = "" then
MsgBox "Apply a filter to the form first."
Else
strGlobalFilter = me.filter
DoCmd.OpenReport "rptLeads", acViewPreview
End If
in the report's "OnOpen" event:
DoCmd.ApplyFilter, strGlobalFilter

It shows now all the records
Thanks för any help
/Regards BigOlle


On form try this:

DoCmd.OpenReport "rptLeads", acPreview, , strGlobalFilter

without "OnOpen" event on Report.

It must work!

--
Gox
Feb 7 '06 #2
Hi Thanks a lot.
Now it works perfekt.
I made it work after adding two commas, ( ,, ) after acPreview
DoCmd.OpenReport "rptLeads", acPreview, , strGlobalFilter

Super
/Regards BigOlle

Feb 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joelle | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.