Combo Box

G

Guest

I have a combo box used to select employees for review. I have 5 columns in
the pulldown portion of the combo box and the box is bound to column 5, which
is the EmployeeNumber. I have it this way so that the user can search by the
first column (LastName) by typing the Last Name of the employee, but the
number will be used for any further purposes. The same combo box is used to
enter an EmployeeNumber that needs to be added to the table.

I think my question is two-fold:
1) After selecting an employee from the list, the contents of the combo box
always displays the value of the first column of the pulldown (LastName) even
though the box is bound to column 5 (EmployeeNumber). How can I get the
EmployeeNumber to display in the box?

2) If a new employee number is entered that needs to be added, Access seems
to be attempting to add the number to the LastName not the EmployeeNumber and
produces an error that the entered text cannot be found.

If I modify the combo box pulldown so that EmployeeNumber is the first
column and the combo box is bound to that, everything works fine. Except
that the user now needs to scroll down thru the pulldown to find an
employee--they cannot type the last name to search.

Thanks in advance for any ideas.
 
R

Ron2005

In one sense, a very simple answer:

Don't use the same combo box. And in fact you cannot without some
special code, because the program assums that the field is the employee
last name and does not recognize when it is a number.

What is triggering it to do the search and say "cannot be found"? It is
most probably a specific event. have the event check for numeric and if
it is numeric then do something entirely different than if it is not
numeric.
 

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