Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
suleyman.mutuwa@gmail.com - 09 Jul 2007 17:11 GMT
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
Bob Quintal - 09 Jul 2007 17:07 GMT
> Hi,
> I need assistance in creating a multiple field search box, i
[quoted text clipped - 23 lines]
> 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
Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

pointer - 12 Jul 2007 13:22 GMT
> suleyman.mut...@gmail.com wrote innews:1183997466.481906.174500@i13g2000prf.googlegroups.com:
>
[quoted text clipped - 63 lines]
>
> - Show quoted text -
Hey Bob, Hey steve profound thanks for your assistance, i'll give your
solutions a try.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.