How to get matching values with list box and dropdown property?

J

Jack Darsa

Hello,
I want to define a list box with dropdown property, but i don't want to
limit the choices the the first character only ,but to any consecutive
characters typed by the user. For example:
if the list contains
abcdef
abdeg
abchi
bcdef

The outcome should be:

input value shown from the list (rows)
b 1,2,3,4
bc 1,3,4
bcd 1,4

In this example the list is not limited only to the first characters , but
to any string with the typed characters.
Anybody can help me ?
Jack
 
D

Douglas J. Steele

Gee, did you ask this in enough groups? This has absolutely nothing to do
with ActiveX controls, command bars, conversion, data access pages, the
developer's toolkit nor (I suspect, since I can't see all of the groups to
which you posted this) most of the other groups to which you posted this
question.

It sounds as though you're talking about a combo box, not a list box. List
boxes don't have a dropdown property, at least not in Access.

If what you're trying to do is allow them to type bcd in the box of the
combo box, and have it find abcdef as a possible match, I don't believe it
can be done.

If what you want is have them type bcd into a separate text box, and then
have the combo box limited to only those records which match what was typed
into the text box, base the combo box on a query that includes a Where
clause along the links of LIKE "*" & [Forms]![FormName]![TextBox] & "*",
where you need to replace FormName and ListName with the appropriate names.
 
J

Jeff Boyce

Jack

Asking a fairly specific question by shotgunning a large number of
newsgroups is considered impolite -- you've asked a lot of people to work on
the same problem, and you've used more server resources. In the future, if
you aren't certain which group to ask in, try one -- the folks who respond
will advise you if you've picked incorrectly.

In Access, listboxes don't have "dropdown" properties. Combo boxes do.

Also, listboxes (and combo boxes) don't "hold" data, they merely display
what your underlying tables hold, perhaps filtered through a query.

If you are trying to find the rows that match a search string (your example,
"bcd"), use a query and the "Like" operator, with wildcards. Check Access
HELP for more information on "Like" and "wildcard".
 
R

Ron Weiner

List Boxed do NOT have a DropDown Property. Sounds like you want a list box
whose row source is controled by a text box. All you need to do is change
the list box row source using the value in the text box. For example:

lstYourListBox.RowSource = "Select YourColumm From YourTable Where
YourColumn Like '*" & txtYourTextBox.Value & "*' Order By YourColumn;"

Should give the results you want.

Ron W
 
Ê

Ê©½¡¿µ

I 'm a Chinese ,I 'd like to make friends with you(if you can see this
letter!).Because through this ,I can
practise my English.At the same time ,I can know more about the world!!!

If you want to make friends with me ,please write to me.My email address is
(e-mail address removed)

Ilook forword to hearing from you!!!
 

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