473,385 Members | 2,005 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,385 software developers and data experts.

How to clear filter to display all data in ms access 2007?

99
I have a combobox that filters data on the form in the afterupdate event.
Following is the query I have been trying to use to filter data.This code filters data effectively but the problem that I am facing is that when I select "<ALL>" from the combobox no data is displayed.What could be wrong?How can I display all the data of the form on selection of "<ALL>"
Expand|Select|Wrap|Line Numbers
  1. Dim strCriteria As String
  2.    strCriteria = "[Jobno]='" & cboPMNO & "'"
  3.       Set rst = Me.RecordsetClone
  4. If strCriteria = "<ALL>" Then
  5.       Me.FilterOn = False
  6. ElseIf rst.NoMatch Then
  7.       MsgBox "No entry found"
  8. Else
  9.     Me.FilterOn = False
  10.     Me.Filter = strCriteria
  11.     Me.FilterOn = True
  12. End If
Apr 16 '12 #1

✓ answered by MikeTheBike

Hi

Shouldn't this
Expand|Select|Wrap|Line Numbers
  1. If strCriteria = "<ALL>" Then 
be this
Expand|Select|Wrap|Line Numbers
  1. If cboPMNO = "<ALL>" Then 
??

Also you hve not filtered the RecorsetClone before you tested for NoMatch !??


MTB

2 3628
MikeTheBike
639 Expert 512MB
Hi

Shouldn't this
Expand|Select|Wrap|Line Numbers
  1. If strCriteria = "<ALL>" Then 
be this
Expand|Select|Wrap|Line Numbers
  1. If cboPMNO = "<ALL>" Then 
??

Also you hve not filtered the RecorsetClone before you tested for NoMatch !??


MTB
Apr 16 '12 #2
HiGu
99
That's one big point that I was missing.
It shoud be cboPMNO..Thanks a lot.Instead of line#5 I am using this
Expand|Select|Wrap|Line Numbers
  1. Docmd.ShowAllRecords
I am testing for NoMatch and then fiIltering,I think.I thought if I check for NoMatch before this then it's bound to have no match as <ALL> is not in the table.The condition for all records is not filteringI guess.
Apr 16 '12 #3

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

Similar topics

3
by: Wayne | last post by:
I downloaded the Office 2007 Beta today and have been clicking around Access and the other Office Apps. They all have clear type switched on despite the fact that I have it turned off in Windows. ...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
1
by: David1129 | last post by:
I'm working on testing a large application with Access 2007. It has been running under 2003 and XP with no obvious errors. However with 2007 many forms seem to have lost the ability to filter....
5
by: Ira Solomon | last post by:
Hi: Any quick opinions on Access 2007? Has anyone got this to coexist with Access 2003? Thanks Ira
5
by: ARC | last post by:
Hello, A user posted a reply to a post of mine regarding the fact that Access 2007 would be free, or maybe I misunderstood? All I could find on Microsoft's site was information regarding the...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
4
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no...
1
by: Lpitt56 | last post by:
I am running MS Access 2007 and I want to update an Outlook Address book from my Access Database. I started out by importing the Outlook Address Book as a linked table and it linked fine. I then...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
by: Elaine Huseby | last post by:
I have a form "PartsAndInvoices that has all the parts in the database listed in split form view. I want the user to use Access 2007's filter section on the ribbon to choose mutiple filters....
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.