Filtering info from a database

S

Spike

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.
 
T

Tim Williams

Assuming you mean an ADO recordset, it does support more than one
criteria.

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

Tim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top