Searching within a combo box by any column

M

Meesh

Hello- I have created a bound combo box with three columns. The bound column
is 1 (the ID number). Column 2 is the first name and Column 3 is the last
name. I am using this for data entry and am hoping to be able look up a
record either by typing in the ID# or the Last Name. Currently, I am able to
type in the ID# and the lookup finds what I am looking for. But when I type
in the LAst Name, it doesn not recognize this. Please, can someone help?
Please let me know if you need any further information. Thanks!
 
D

Dirk Goldgar

Meesh said:
Hello- I have created a bound combo box with three columns. The bound
column
is 1 (the ID number). Column 2 is the first name and Column 3 is the last
name. I am using this for data entry and am hoping to be able look up a
record either by typing in the ID# or the Last Name. Currently, I am able
to
type in the ID# and the lookup finds what I am looking for. But when I
type
in the LAst Name, it doesn not recognize this. Please, can someone help?
Please let me know if you need any further information. Thanks!


You could have a second combo box, bound to the same field, designed to
lookup by name instead of ID. But having two combo boxes might be a little
confusing. You could use an option group, maybe, to let the user choose to
lookup by ID or by Name, and then show one combo box and hide the other
based on what the user has chosen. Or use a single combo box and change its
properties to lookup by ID or Name -- you would do that by changing the
combo box's properties to make the ID column or the Lastname column the
first visible column (any preceding columns would have their widths set to
0).

Another alternative might be to have a bound combo box to look up the name,
and an unbound text box where the user will type the ID number. When they
update that text box, code in its AfterUpdate event would find that ID
number in the combo box's list, and set the combo box to the row that
matches the ID entered.
 

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