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

Multiple selections

Hi all,

looking for a direction on how to accomplish something someone has
surely done before:

Have a List Box with article desciptions.
Want 3 text boxes where someone enters what they are looking for.
Dealing with chemicals, there are several ways to write the same thing
(order of words)

In box 1 "*tetra*", box 2 "*meth*" and in box 3 "*prop*"

I want it to find

1-Tetramethylpropanol (in the order above)
4-Methanolpropyltetrachlorine (same words, different locations)
2,4-Propyl-2-methoxyl-1-tetrazin (again different locations)

Reayyl need general ideas how to best get there without taking a huge
performance reduction.

Thanks

Apr 5 '07 #1
2 1689
So using the three text boxes like that should return anything
containing all those values, or anything containing one or more?
Depending on that question, I imagine creating a sql string that has
the three boxes Or'd or And'd together as criteria would do it. You'd
have to account for the possibility of them not being filled in. After
clicking a "Search" button perhaps, you would in code determine which
to include in the string, contrsuct the sql, apply it to the listbox
RowSource property and requery it. If you need specific help, then you
might need to provide more detail about the controls, query fields and
criteria requirements.

Apr 5 '07 #2
Now these are just some of those "half-baked ideas" ...

If a guy ("a guy" being the original poster) was to lookat the "Advanced
Search" page at Google
http://www.google.ca/advanced_search?hl=en and design an input form in
Access similar to that ...

and then if "a guy" was to follow storrboys idea of building an sql
statement in code ...
I even have some sample code, posted in 2002, that you could use as a
starting point
http://groups.google.ca/groups?as_q=...=2007&safe=off

And if "a guy" had a datasheet style subform that used the resulting SQL as
it's RecordSource ...
then maybe "a guy" could duplicate this functionality?

Other options ???
=============
In
InStr
Like
FindRecord
=============
OR

"Roll your own" version of the FindRecord dialog box ... plugging search
data and search methods in from form references ???

Option Compare Database
Option Explicit

Dim vFindWhat
Dim vMatch
Dim vMatchCase As Boolean
Dim vSearchDirection
Dim vSearchAsFormatted As Boolean
Dim vOnlyCurrentField
Dim vFindFirst As Boolean

'DoCmd.FindRecord findwhat[, match][, matchcase][, search][,
searchasformatted][, onlycurrentfield][, findfirst]
'findwhat An expression that evaluates to text, a number, or a date. The
expression contains the data to search for.
'match One of the following intrinsic constants:
'acAnywhere
'acEntire (Default)
'acStart
'If you leave this argument blank, the default constant (acEntire) is
assumed.
'matchcase Use True (-1) for a case-sensitive search and False (0) for a
search that's not case-sensitive. If you leave this argument blank, the
default (False) is assumed.
'search One of the following intrinsic constants:
'acDown
'acSearchAll (Default)
'acUp
'If you leave this argument blank, the default constant (acSearchAll) is
assumed.
'searchasformatted Use True to search for data as it's formatted and False
to search for data as it's stored in the database. If you leave this
argument blank, the default (False) is assumed.
'onlycurrentfield One of the following intrinsic constants:
'acAll
'acCurrent (Default)
'If you leave this argument blank, the default constant (acCurrent) is
assumed.
'findfirst Use True to start the search at the first record. Use False to
start the search at the record following the current record. If you leave
this argument blank, the default (True) is assumed.

--
HTH, (like I said ... half-baked)
Don
=============================
E-Mail (if you must) My*****@Telus.net

Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code samples are also Access97- based
unless otherwise noted.

================================================== ========================
"storrboy" <st******@sympatico.cawrote in message
news:11*********************@w1g2000hsg.googlegrou ps.com...
So using the three text boxes like that should return anything
containing all those values, or anything containing one or more?
Depending on that question, I imagine creating a sql string that has
the three boxes Or'd or And'd together as criteria would do it. You'd
have to account for the possibility of them not being filled in. After
clicking a "Search" button perhaps, you would in code determine which
to include in the string, contrsuct the sql, apply it to the listbox
RowSource property and requery it. If you need specific help, then you
might need to provide more detail about the controls, query fields and
criteria requirements.

Apr 6 '07 #3

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

Similar topics

1
by: theoryboy | last post by:
I'm trying to implement multiple selection functionality in a Tix Hlist using a control-click. I've bound control-click to a function that uses selection_set to add to the selection, but it doesn't...
1
by: jeffgeorge | last post by:
Trying to create multiple acct reports based on the selection in a list box. I've set the list box for multiple selections, and in the report data source, I have a SQL statement which is reading...
2
by: Craig B. | last post by:
I am relativly new to access 2000 and am having some trouble with a report. I am not sure what I want to do is something I can do in access. I want to be able to choose from a combo box multiple...
0
by: bill yeager | last post by:
Duray, it helps in regards to knowing how to get the items that were selected in the lisbox, but I'm going in reverse --- after I get the items from the db that were selected, I'd like to be able...
2
by: Steffen Loringer | last post by:
Hi all, may be an easy question: How can I allow multiple selections in a dropdownlist? Thanks Steffen
4
by: tbayse | last post by:
Hello, I have a question about making multiple selection queries in Access. I am running windows XP and Access 2003. Up until this point I had a form where a user would make single selections from...
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
0
by: Gunnar Hurtig | last post by:
Hi All I am relatively new to Tkinter and am putting a wraparound to the ATNF ASAP program. In one part I present several long lists in list boxes for selection. My code will remember the multiple...
0
by: Germaris | last post by:
Hi there! Is it possible to make multiple selections in a ComboBox ? i.e. make n consecutive selections and store them in an array or make n selections in the open list of the CB by using (for...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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:
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.