473,378 Members | 1,679 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,378 software developers and data experts.

The problem is the filter is not working?????

HELP!!!!!It driving me crazy

The user picks a monitor from the monitor drop down when they click on the report button they should only see the records from that monitor. check91 if they click that then they will see all records for voicemail category.everything is accessed from a switchboard type form. the filter does not work???

This is the code in the report event on_open:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. Dim rpt As Report
  3. Dim k As String
  4. Dim strfilter As String
  5. Set rpt = Reports!Voicemail_r
  6.  
  7. Dim d
  8. d = Forms!Switchboard!MonitorCombo.Column(1)
  9. 'Stop
  10.         k = "VoicemailQ.MonID"
  11.         If Forms!Switchboard!Check91 = True Then
  12.         strfilter = BuildCriteria(k, dbInteger, ">0")
  13.         ElseIf Forms!Switchboard!Check91 = False Then
  14.         strfilter = BuildCriteria(k, dbInteger, d)
  15.  
  16. 'Set FilterOn property; form now shows filtered records
  17.         rpt.FilterOn = True
  18.         rpt.Filter = strfilter
  19.  
  20. End If
  21. End Sub
Aug 12 '10 #1
4 2024
NeoPa
32,556 Expert Mod 16PB
Is this supposed to be a joke? Most of the code (All the important code) is contained in BuildCriteria() which you haven't included and your explanation of the problem doesn't have a recognisable sentence in it.

If you want some help, may I suggest you start with a question that has the very basics at least. If you're as desperate as you say, then surely two minutes of your time is not too much of a commitment for you.
Aug 12 '10 #2
The problem is line 17 and 18. the build critieria does what it is suppose to do. In order to filter the records I believe the filter property should be on?? the issue is when I click on the reports button the filtor in line 17 and 18 does not happen thus effecting lines 13 and 14. These lines are suppose to give me just the records for what ever is selected in d = Forms!Switchboard!MonitorCombo.Column(1). Am I using the right code or arguments for the Filteron method/property.
Aug 12 '10 #3
Stewart Ross
2,545 Expert Mod 2GB
You have the FilterOn property set before you apply the filter in lines 17 and 18- switch those two lines round:

Expand|Select|Wrap|Line Numbers
  1.    rpt.Filter = strfilter 
  2.    rpt.FilterOn = True

Beyond that, if your filtering isn't working you'd need to show us an example of the filter string you are applying to the report, because the most likely fault then is within the filter you are applying to your report.

You are at present telling us to take on trust that the output from your Buildcriteria function is OK, but as NeoPa advised this is the bit that is actually doing all the work - you should never assume that bespoke code can't be at fault, or you'll spend unnecessary time looking at the wrong things - and so will we!! It is simple to post an example of the filter string that is really being applied, and then we'll know for sure whether applying it can work or not.

-Stewart
Aug 14 '10 #4
NeoPa
32,556 Expert Mod 16PB
df13427:
The problem is line 17 and 18. the build critieria does what it is suppose to do.
So, let me see if I have this right.

You want help from us, but when we don't say what you want to hear, then you (rudely) ignore what we say and tell us how it should be done. Interesting approach. I'll observe with curiosity as you solve this without help then :D

By the way, if you ever get as far as the first obvious step (a question with the basic data in) I'll be more than happy to help. Good luck.
Aug 15 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
2
by: Anandan | last post by:
Hi, In our Project we use Dataset to load the Grid with Values. We have some criteria to filter the values to be shown in the Grid. For that we used the SELECT command to filter the Same...
0
by: Simon | last post by:
Dear reader, Under Tools>>Options>>Tables/Queries there is a setting possible of "SQL Server Compatible Syntax (ANSI 92)". The two tick boxes here are · "This database" · ...
3
by: Henrootje | last post by:
I have a form based on the query: SELECT tblCreditGeld.CG_Selected, tblCreditGeld.CG_ClientSelected, tblCreditGeld.CG_ComplexSelected, tblCreditGeld.CG_OKGR_ID, tblCreditGeld.CG_OKGR_IDN,...
9
GazMathias
by: GazMathias | last post by:
Hi Guys, Acc2003. I have a form that is misbehaving by suddenly refusing to apply a filter I am passing to it. In a nutshell, I use a public variable to control the form's behaviour called...
4
by: kcropper | last post by:
Hi, I’ve been trolling these forums for a while now, and while I’ve found other related threads (e.g., http://bytes.com/topic/access/answers/702416-search-code-how-filter-using-code-sql), nothing has...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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.