How can I create a multiple field search box that use logical operators in an option box?

B

Bob Quintal

(e-mail address removed) wrote in
Hi,
I need assistance in creating a multiple field search box, i
have a screen shot but i couldn't find a way to include it in
this message. I have been battling with this problem for
weeks. I'm trying to use ms access 2003 to create a search box
similar to one i saw in foxpro. It searches all the fields in
only one table so each
table has a search box for it. Here is a description for the
search box for the community table which is one of the tables
in the database.
It has a drop down list that selects all the fields in the
table such as area code for the community, community code, and
community description. Beside it is another dropdown list box
for operator which you can use to select operators such as
plus, equals to (=), greater than, less than, is null,
between, in. beside this is a box that display value.
Below all of these form fileds is an option box with options
for and, or.
and beneath this is another row just like the one before the
options box.
Below theses are three buttons for search, all, cancel. What's
really hard for me to figure out is the option box that uses
AND, OR to combine
the two diffrent search groups.
I'd be glad to send a screen shot to anyone who requires it to
assist me.
Thank you
The option group returns a number assigned to each option in the
group.

Build the filter string for the first row,


stWhereClause1 = Me.cboFields1 + " " + cboOperator1 + " """ +
txtValue1 + """"

The + concatenation operators should return nothing if the
textbox is empty.

Build stWhereClause2 using the equivalent controls in hte next
row

Now we need to test that each whereclause has been populated,
If len(StwhereClause1)> 0 and Len(stWhereClause2) > 0 then
If groupJoinType = 1 then
StwhereClause = stwhereClause1 " AND " stwhereclause2
elseif groupJoinType = 2 then
StwhereClause = stwhereClause1 " OR " stwhereclause2
end if
elseif len(StwhereClause1)> 0 then
StwhereClause = stwhereClause1
elseif len(StwhereClause2)> 0 then
StwhereClause = stwhereClause2
else
StwhereClause = ""
end if
 
S

suleyman.mutuwa

Hi,
I need assistance in creating a multiple field search box, i have a
screen shot but i couldn't find a way to include it in this message.
I have been battling with this problem for weeks.
I'm trying to use ms access 2003 to create a search box similar to
one i saw in foxpro. It searches all the fields in only one table so
each
table has a search box for it. Here is a description for the search
box for the community table which is one of the tables in the
database.
It has a drop down list that selects all the fields in the table such
as area code for the community, community code, and community
description. Beside it is another dropdown list box for operator
which you can use to select operators such as plus, equals to (=),
greater than, less than, is null, between, in.
beside this is a box that display value.
Below all of these form fileds is an option box with options for and,
or.
and beneath this is another row just like the one before the options
box.
Below theses are three buttons for search, all, cancel. What's really
hard for me to figure out is the option box that uses AND, OR to
combine
the two diffrent search groups.
I'd be glad to send a screen shot to anyone who requires it to assist
me.
Thank you
 
P

pointer

(e-mail address removed) wrote in





The option group returns a number assigned to each option in the
group.

Build the filter string for the first row,

stWhereClause1 = Me.cboFields1 + " " + cboOperator1 + " """ +
txtValue1 + """"

The + concatenation operators should return nothing if the
textbox is empty.

Build stWhereClause2 using the equivalent controls in hte next
row

Now we need to test that each whereclause has been populated,
If len(StwhereClause1)> 0 and Len(stWhereClause2) > 0 then
If groupJoinType = 1 then
StwhereClause = stwhereClause1 " AND " stwhereclause2
elseif groupJoinType = 2 then
StwhereClause = stwhereClause1 " OR " stwhereclause2
end if
elseif len(StwhereClause1)> 0 then
StwhereClause = stwhereClause1
elseif len(StwhereClause2)> 0 then
StwhereClause = stwhereClause2
else
StwhereClause = ""
end if
Hey Bob, Hey steve profound thanks for your assistance, i'll give your
solutions a try.
 

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

Top