RowSource & AutoExpand

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!
 
P

Piet Linden

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
 
S

Simon

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.
 

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