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

Filtering info from a database

I'm trying to filter data from a database called "G63" to give a single
result based on two filtering criteria. The problem is I can only get the
result of one filter at a time, as shown in the code below...

function filterByTown(form) {
document.getElementById("table1").dataSrc="#G63"
var filterExpr1 =
form.filter1.options[form.filter1.selectedIndex].value;
var filterTown = "Town =" + filterExpr1;
G63.Filter = filterTown;
G63.Reset();
}

function filterByBusiness(form) {
document.getElementById("table1").dataSrc="#G63"
var filterExpr2 = form.input.value;
var filterBusiness = "Business Type ="+ filterExpr2;
G63.Filter = filterBusiness;
G63.Reset();
}

How can I get the resultant "G63" table to display the common results of
filterTown and filterBusiness together in the same table?

e.g. Say I want to display all the business types which are hotels, but only
occurring in the selected town of Richmond.
The above functions allow me to display all the businesses in Richmond, or
all the hotel businesses in all the towns, but not exclusively the hotels
only in Richmond.

Any help would be greatly appreciated. Thanks.
Jul 23 '05 #1
1 1168
Assuming you mean an ADO recordset, it does support more than one
criteria.

Eg:
G63.Filter = "SupplierID = 20 AND CategoryID = 1"

Tim.

"Spike" <mi*******@yahoo.co.uk> wrote in message
news:d3**********@news.wplus.net...
I'm trying to filter data from a database called "G63" to give a
single result based on two filtering criteria. The problem is I can
only get the result of one filter at a time, as shown in the code
below...

function filterByTown(form) {
document.getElementById("table1").dataSrc="#G63"
var filterExpr1 =
form.filter1.options[form.filter1.selectedIndex].value;
var filterTown = "Town =" + filterExpr1;
G63.Filter = filterTown;
G63.Reset();
}

function filterByBusiness(form) {
document.getElementById("table1").dataSrc="#G63"
var filterExpr2 = form.input.value;
var filterBusiness = "Business Type ="+ filterExpr2;
G63.Filter = filterBusiness;
G63.Reset();
}

How can I get the resultant "G63" table to display the common
results of filterTown and filterBusiness together in the same table?

e.g. Say I want to display all the business types which are hotels,
but only occurring in the selected town of Richmond.
The above functions allow me to display all the businesses in
Richmond, or all the hotel businesses in all the towns, but not
exclusively the hotels only in Richmond.

Any help would be greatly appreciated. Thanks.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
1
by: Aravind | last post by:
Hi folks. My database project has the following: -------------------------------------------------------------------------------- tables: Member: MemName, MemNo , MemType, CourseFaculty...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
7
by: Frank.Sebesta | last post by:
I have a wedge mag stripe reader that I swipe when ask to input information in a query. How do I filter the unwanted characters. Apparently there are two mag stripes that are read every time I...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
2
by: JUAN ERNESTO FLORES BELTRAN | last post by:
Hi you all, I am developping a python application which connects to a database (postresql) and displays the query results on a treeview. In adittion to displaying the info i do need to implement...
6
by: assgar | last post by:
Hi I am trying to get data from a mysql database with php. These dynamic rows may have multiple prices between 1 and 5. I would like to use a drop dropdown to display these prices and allow...
2
by: kevinpond | last post by:
I have a Gridview displaying the results of a stored procedure. The stored procedure is constantly changing so the columns displayed in the data grid are constantly changing. I'd like to give...
3
by: Harry Haller | last post by:
Hello, I want to implement a generic list which will be used to display 7 columns in a GridView. One should be able to sort, filter and page each of the 7 columns. Ideally the filter should be...
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
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
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...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

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.