473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1413
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've converted an ACC97 .mdb file to an ACC2K2 .adp. A report that worked in ACC97 doesn't work in ACC2K2. Report setup: ACC97 ...
8
by: swilson513 | last post by:
In Access97 I was able to have an advance filter on a form that had a Like statement so when you applied the filter EACH time it would asked for the criteria. In 2000 the same filter doesn't asked...
2
by: Wolfgang | last post by:
Hi, I need to timestamp printed records with the printing date. According to the customer's requests the report must be opened in preview-mode and the user clicks on the printer button if he...
7
by: fleece | last post by:
I set up a form for searching criteria and pass the searching result to a report. On this report there is an unbound text box (=.Filter) and shows the searching criteria. It works fine when searching...
3
by: emgallagher | last post by:
I have a form which lists studies. People can filter the form based on details about the study, such as the study type. Currently users filter via the right click method. I would like to be...
1
by: Cara Murphy | last post by:
Hi There! Hoping you are able to help me with a filtering scenario: I have created a pop up form (Filter) to filter a report (Open Issues), which currently has a number of combo boxes which...
5
by: DAHMB | last post by:
Hi all, Using Access 2007 I have a report called Sunday School Attendance based on a Query called qryAttendance the query is as follows: SELECT tblSundaySchoolAttendance.StudentID,...
1
by: Joelle | last post by:
Hi everyone, i am really stack!i need help I have this report:"RequirementObjects_Report",i have also a multiselect listbox whicg contains a list of products.what i want to do is to filter the...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.