RowSource & AutoExpand

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a combobox that I want to display 2 columns: 1)employeeNumber and
2)EmployeeName. When the user has clicked on the combo I want them to be
able to key in the letters of the last name to scroll down the list to find a
match. When the user finds the name they are looking for and select it, I'd
like the employeeNumber to show in the text portion of the combo and the
EmployeeNumber would be the BoundColumn.
I've tried numerous ways to make this work and can't seem to figure it out.
How do I do this? Using Access 2000.
Thanks in advance for any help!
 
I have a combobox that I want to display 2 columns: 1)employeeNumber and
2)EmployeeName.  When the user has clicked on the combo I want them to be
able to key in the letters of the last name to scroll down the list to find a
match. When the user finds the name they are looking for and select it, I'd
like the employeeNumber to show in the text portion of the combo and the
EmployeeNumber would be the BoundColumn.
I've tried numerous ways to make this work and can't seem to figure it out.  
How do I do this? Using Access 2000.
Thanks in advance for any help!

Normally one does this by setting the Key column (employee number) as
the leftmost column, and setting its width to zero. (so the user
doesn't see it). But you *bind* to the leftmost column (employee
number), so that's what gets saved. usually, though, one would not
show the Employee Number... (since they're usually meaningless). The
only way I can think of doing this is to have an unbound control on
your form that shows the hidden column

Set the controlsource to = Me.Controls("cboEmployeeNumber").Column
(0)

where "cboEmployeeNumber" is the name of your combobox
 
Thanks for the reply, Piet.
In this case, I need the employee id because this is a screen for setting up
users.
I ended up creating another textbox that I dump the id into when the user
name is selected from the list.
 
Back
Top