cboBox

  • Thread starter Thread starter Jeff Adams
  • Start date Start date
J

Jeff Adams

Access 2000

I have a combo box that uses a trim funtion to show a
persons name (first middle initial last) and does not show
the primary key which is employee id. I need to copy the
employee id to a text box when a persons name is
selected. How do I go about doing this?

I attempted this by setting the control source in the text
box to =[cboEmp]. This seems to come up with the same
employee id regardless which name is selected. Please
help. TIA
 
Jeff

Add the ID field to the combo box. On the column widths of the combo box,
set the value to 0" (corresponding to the ID field).

When you want to reference the ID field, do the following:

Me.TextBox = Me.ComboBox.Column(x)

(where 'X' is the position of the ID column minus 1, since the columns
collection is 0-based)

HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top