Lookup value of text box in another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I am trying to alter the number of fields I need to input on the form.
What I am trying to do is, once I input a Person ID field in a text box
(txtEmpID), I am trying to get another textbox to look up the name of the
person in another text box (txtEmpName)

eg txtEmpID - 123
once I have input this then

automatically in txtEmpName - Jez appears

how can this be done? I have the Emp ID and Names in a table called tblEmp

Thanks Jez
 
If you really want to do it that way you could include tblEmp in the form's
record source query. When you enter the number (which I assume is stored),
the text box can display the name. The details would depend somewhat on how
you have the database set up. However, you may find it more convenient to
select the name. The combo box wizard should be able to guide you through
storing the number while showing the name. In brief, the combo box row
source could include EmpID, FirstName from tblEmp. The column count is 2,
the bound column is 1, and the column widths are something like 0";1.5".
Select the name, and the number will be stored. You can display the number
if you prefer, and set the value of an unbound text box to
=[ComboBoxName].Column(1)
Note that the columns are numbered starting with 0, so 1 is actually the
second column.
 
Back
Top