combobox

  • Thread starter spieters via AccessMonster.com
  • Start date
S

spieters via AccessMonster.com

Dear All,

I would like to type e.g. "SA" in an customer field in a combobox and it
selects all customers that starts with "SA" and all costumers that has a "SA"
in their name, e.g. Satur and also maSAsu.

Thanks in advance for your help
 
A

Al Campagna

spieters,
See Access Help under Auto Expand.
Auto Expand attempts to find a legitimate entry from a combo box
as you type. Set that property to Yes for your combo.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
S

spieters via AccessMonster.com

Al said:
spieters,
See Access Help under Auto Expand.
Auto Expand attempts to find a legitimate entry from a combo box
as you type. Set that property to Yes for your combo.
Dear All,
[quoted text clipped - 4 lines]
Thanks in advance for your help


Dear Al,

The Auto Expand is already on "yes" but I only get the starting part of the
field. E.g. if I type Sa, it will show all fields starting with Sa. I need it
to show all fields that contains "sa", both starting with "sa" and "sa" as a
part of the field.
 
A

Al Campagna

spieters,
Sorry I missed that point...
Please don't delete critical info from previous threads. It's best
to see all of the problem and solution on one post.

Well, I haven't heard of doing that before... but...
I created a 1 column combobox with a concatenated value of
LastName & ", " & FirstName
and named that combo cboFullName.

Using the combo's OnChange event...
(Turn off LimitToList and AutoExpand)

Private Sub cboFullName_Change()
Dim TextLength as Integer
Refresh
TextLength = Len(FullName)
Me.cboFullName.SelStart = TextLength
Me.cboFullName.Dropdown
End Sub

This appears to do just what you asked for, as well as acting like
Auto Expand. Realize that the combo must requery on each character
entry (speed?), and you can use/not use the DropDown if you want.
I can not guarantee this, but it appears to do the trick. You may
have to tweak further...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

spieters via AccessMonster.com said:
Al said:
spieters,
See Access Help under Auto Expand.
Auto Expand attempts to find a legitimate entry from a combo box
as you type. Set that property to Yes for your combo.
Dear All,
[quoted text clipped - 4 lines]
Thanks in advance for your help


Dear Al,

The Auto Expand is already on "yes" but I only get the starting part of
the
field. E.g. if I type Sa, it will show all fields starting with Sa. I need
it
to show all fields that contains "sa", both starting with "sa" and "sa" as
a
part of the field.
 
K

KARL DEWEY

Try this --
WHERE [Customer] Like "*" & [Forms]![YourFormName]![YourComboName] & "*"
 
A

Al Campagna

spieters,
Sorry... I forgot to describe the criteria behind your combobox...
Seeing Karl Dewey's response woke me up!
What he used as the criteria in the RowSource of the combo is
exactly what I had used in my working example.
So, put the two posts together, and it should work...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


spieters via AccessMonster.com said:
Al said:
spieters,
See Access Help under Auto Expand.
Auto Expand attempts to find a legitimate entry from a combo box
as you type. Set that property to Yes for your combo.
Dear All,
[quoted text clipped - 4 lines]
Thanks in advance for your help


Dear Al,

The Auto Expand is already on "yes" but I only get the starting part of
the
field. E.g. if I type Sa, it will show all fields starting with Sa. I need
it
to show all fields that contains "sa", both starting with "sa" and "sa" as
a
part of the field.
 
S

spieters via AccessMonster.com

Al Thank you very much, after little tweaking, it works splendid.

Thanks again.

Stella

Al said:
spieters,
Sorry... I forgot to describe the criteria behind your combobox...
Seeing Karl Dewey's response woke me up!
What he used as the criteria in the RowSource of the combo is
exactly what I had used in my working example.
So, put the two posts together, and it should work...[quoted text clipped - 15 lines]
a
part of the field.
 

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