Hi,
I need to create a filter form that gives a user flexibility in selection any fields in a table and in filtering records based on conditions, such as range. I've read some about a multi-select list box, but it does not give flexibility of choosing any fields. Can anybody help me on this and tell me what subject I should read? Many thanks in advance!
[I am using Access 2000 (Window XP) and ODBC connection to MySQL server table]
12 1508
Hi
If you are using Access have you tried the "Filter By Form" technique.
I personaly don't like it because users can filter for anything..... then not understand the results, or not be able to revert to normal form, or call for support...
However, if used intelligently it allows you to filter on multiple fields, I think including ranges with the correct syntax, without coding!
S7
Hi
If you are using Access have you tried the "Filter By Form" technique.
I personaly don't like it because users can filter for anything..... then not understand the results, or not be able to revert to normal form, or call for support...
However, if used intelligently it allows you to filter on multiple fields, I think including ranges with the correct syntax, without coding!
S7
Thanks for you reply, Sierra7!
In order to revert to normal form have you tried to use "Remove Filter/Sort"?
Anyway, I will look into more as you suggested and will get back. Thanks again!
Thanks for you reply, Sierra7!
In order to revert to normal form have you tried to use "Remove Filter/Sort"?
Anyway, I will look into more as you suggested and will get back. Thanks again!
The problem is that I need to create a filter form that executing the select query with information entered by a user in 'WHERE' clause. That's what I meant 'flexibility'. For example,
SELECT a, b, c, d, FROM mydb WHERE xx = yy
xx and yy will be entered by a user. Can anybody help on how I should approach? Thanks!
Hi
Yeh, 'I' have no problem removing the filter etc but the problem I have found with some users was that they did not realise their data had been filtered, then tried browsing for something else. Anyway, that's not your problem.
Sorry to be dim but I'm a bit confused about what you mean by a 'Filter Form'
Are you suggesting that the users will enter parameters in your form to ;- - Display matching data in the current form ?
- Set criteria for opening another form or report ?
- Create an SQL string for some other purpose to use elsewhere?
Or to put to another way, when you execute your query where will the results display?
Should the users select a, b, c & d all the time or sometimes just a, b & c? (incidentally I would drop the last comma in your string or it won't work) and the WHERE can be also be on a, b, c or d ?
S7
Hi
Yeh, 'I' have no problem removing the filter etc but the problem I have found with some users was that they did not realise their data had been filtered, then tried browsing for something else. Anyway, that's not your problem.
Sorry to be dim but I'm a bit confused about what you mean by a 'Filter Form'
Are you suggesting that the users will enter parameters in your form to ;-- Display matching data in the current form ?
- Set criteria for opening another form or report ?
- Create an SQL string for some other purpose to use elsewhere?
Or to put to another way, when you execute your query where will the results display?
Should the users select a, b, c & d all the time or sometimes just a, b & c? (incidentally I would drop the last comma in your string or it won't work) and the WHERE can be also be on a, b, c or d ?
S7
Hi, Sierra7!
Yes, the SELECT statement shoould be the same because that's what we want to filter, but WHERE should be any column heading in the table.
We want to see a, b, c, d all the time, where the condition is changed every time. In other words we want to filter a, b, c, d by other column heading, e.g., spanish=1 and county="LA", something like this, for data analyzing purpose.
The WHERE part has to be flexible that a user can select any column heading in the table as necessary. So my question falls into 1. Thanks!
Hi again Loisk
From your last posting I have picked up; - The WHERE can be any column heading in the table
- Display data in current form (I presume every field (column) is shown)
Thanks for clearing the confusion because some people refer to a Filter Form as a 'dialogue' form that sets conditions for opening a Report or another form.
What you seem to want to do is set a filter on the current form but because of the flexibility you say you need then I go back to my original suggestion of using 'Filter By Form'.
Incase we are crossing purposes again, this is initiated by clicking on the small icon with a filter-funnel and a square 'form' in the background. If you are using the default menus/toolbars it is the one beside the 'funnel with a lightning bolt' in the top menu, or can also be brought up by right clicking in the centre of the form.
Oh! It has just occurred to me that you might be using UNBOUND forms with MySQL, (in which case the Access Filter By Form will not work!) so I had better stop here until you let me know.
However, I will add this reference Example Filtering on a Form
I wait until you advise you are using Bound or Unbound forms
S7
Hi again Loisk
From your last posting I have picked up;- The WHERE can be any column heading in the table
- Display data in current form (I presume every field (column) is shown)
Thanks for clearing the confusion because some people refer to a Filter Form as a 'dialogue' form that sets conditions for opening a Report or another form.
What you seem to want to do is set a filter on the current form but because of the flexibility you say you need then I go back to my original suggestion of using 'Filter By Form'.
Incase we are crossing purposes again, this is initiated by clicking on the small icon with a filter-funnel and a square 'form' in the background. If you are using the default menus/toolbars it is the one beside the 'funnel with a lightning bolt' in the top menu, or can also be brought up by right clicking in the centre of the form.
Oh! It has just occurred to me that you might be using UNBOUND forms with MySQL, (in which case the Access Filter By Form will not work!) so I had better stop here until you let me know.
However, I will add this reference Example Filtering on a Form
I wait until you advise you are using Bound or Unbound forms
S7
Hi,
I am using Bound form connected to MySQL table via ODBC.
Thank you so much, sierra7!
Hi,
I am using Bound form connected to MySQL table via ODBC.
Thank you so much, sierra7!
That's good! The reason that I am banging on about Filter By Form is that you said you wanted flexibility; to filter on any field; to state ranges and I think you hinted about multi-select (By which I mean not just filter by "Florida" but "Florida and New Mexico")
And I believe you can do all this using Filter By Form withou writing a line of code!
You users will have to learn certain rules of syntax for > , < , BETWEEN, LIKE and IN etc
If you read the topic in Help it should be self explanatory but let's see if this is what you want first.
S7
That's good! The reason that I am banging on about Filter By Form is that you said you wanted flexibility; to filter on any field; to state ranges and I think you hinted about multi-select (By which I mean not just filter by "Florida" but "Florida and New Mexico")
And I believe you can do all this using Filter By Form withou writing a line of code!
You users will have to learn certain rules of syntax for > , < , BETWEEN, LIKE and IN etc
If you read the topic in Help it should be self explanatory but let's see if this is what you want first.
S7
Thanks for your prompt reply!
I did read about Multi-select listbox or so, but it's still not what I am looking for.
I need to be able to select not just by value in a column, but should be able to select any column heading at filtering. I am not sure how I put it in better way in explanation. Multi-select box is flexible in selecting multi values in a column. To reiterate, in WHERE clause, for instance, in where column=value this column should be chosen by a user at the time a user filters.
I hope I am not making you irritated by my being inefficient in describing the problem.
That's exactly what Filter By Form allows!
You can filter by any or all fields! Even putting a range in the field (with the correct syntax)
You had better give more detailed examples because I can not see where we differ.
S7
That's exactly what Filter By Form allows!
You can filter by any or all fields! Even putting a range in the field (with the correct syntax)
You had better give more detailed examples because I can not see where we differ.
S7
Hi again!
Now I see what I was missing in describing my problem!
I know that the Filter By Form can do this, but the difference is that...
The displayed fields are only a few, like 4 or 5 columns out of more than 20, and selecting column will be any column in those 20 plus columns that are not shown in the form. Hope that I am making it clearer than before.
That makes life difficult !
I think in this case you will need to create a new form with 20 or so unbound TextBoxes each representing one of your fields, then within these boxes you set up you criteria string and with a command button you open the form you have been referring to -
-
DoCmd.OpenForm "frmThatsBeenReferredTo", , , strCriteria
-
Setting up the string is relatively easy. My preference is to declare a string variable for each of the terms to be involved in the filter. I'll call them s1, s2, s3 etc but it is usually more helpful to represent the fieldnames. Then - strCriteria = s1 & s2 & s3 ' . . . etc
-
DoCmd.OpenForm "frmThatsBeenReferredTo", , , strCriteria
Obviously s1 must be somthing like "[ID]>1" so the term is always present, then s2 can be "and [LangID]=" & Me.txtLangID, or if you are not filtering on LangID then s2="". Get the idea? You will have to be careful setting up you criteria terms as to which are text values, which are numbers and which are dates to get the correct syntax.
I normally set all the terms (except first) to blank and then adjust them on the After_Update event of the unbound text box. So if there was a box called txtLangID the code would be something like; - If Me!txtLangID = "" Then
-
s2 =""
-
Else
-
s2 = "and [LangID] =" & Me!txtLangID
-
EndIf
-
Get the basic idea working on a few fields then come back if there are any problems.
I think that with the references already given you should be alright. I would leave the more ambitious 'multi-select' aspect until the basics work ok.
S7
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rizyak |
last post by:
This message is cross posted in
alt.comp.lang.php & comp.lang.javascript
I have a form for a user to input an establishment's hours and what time an
event is taking place. After the user inputs...
|
by: jkmambo |
last post by:
Suppose I have two tables A and B
Table A has fields A1, A2, A3, ... A9
Table B has fields B1, B2, B3, ... B9
I want to select all fields in A and only B3 in table B. I dont want to
list...
|
by: Elias Farah |
last post by:
Hello All,
I hope someone can give me (and other keen access enthusiasts) some
helpful information to explain how to most efficiently filter Queries
& subqueies.
Consider this common simple...
|
by: Ramesh |
last post by:
hi,
I am selecting fields from three table for manupulating
data and i want to display total number of records
selected. But i am always getting -1 value, eventhough
1000 of records are selected....
|
by: Patrick |
last post by:
I'm working on a contact management application, and need a hand with one
aspect...
Here's what I want to create:
------------------------------------
A form split into two parts. There is a...
|
by: JDiamond |
last post by:
Hi,
I have a table called Hosts. The Hosts table contains the following
fields:
Each field represents a step in the project. The tech that completes
each step initials the respective...
|
by: Gordon Youd |
last post by:
Hi, the group helped me with my last post "Select query from query1 or
query2".
How do I show " JourneyBookingFormQuery.Req ArrTime" on the "Out column in
sortkey" but not in "In column in...
|
by: NeoPa |
last post by:
CHAPTER 1 - TABLE OF CONTENTS (Including attached database)
CHAPTER 2 - INTRODUCTION
CHAPTER 3 - TABLE LAYOUT
CHAPTER 4 - FORM LAYOUT
CHAPTER 5 - FORM MODULE
CHAPTER 6 - CODE DISCUSSION (FILTER...
|
by: NeoPa |
last post by:
Cascaded Form Filtering
CHAPTER 1 - TABLE OF CONTENTS (Including attached database)
CHAPTER 2 - INTRODUCTION
CHAPTER 3 - TABLE LAYOUT
CHAPTER 4 - FORM LAYOUT
CHAPTER 5 - FORM MODULE
CHAPTER 6...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
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...
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |