First off, I'd add some sort of ID field to your tblEmp Table. This helps deal with situations where, for example, employees have the same name (or at least the same last name). As your database grows, it also allows you to save space and decrease the complexity of your database by allowing you to reference the Employee by just this ID field instead of their full name.
However, to answer your question, you're right on the money. That's done from the Combo Box's After Update Event.
Assuming you've named your Text boxes tboFirstName, tboLastName, and tboSalary, just use the code below.
Code:
Code:
Dim rstTblEmp as Recordset
Dim strCriteria as String
' Snatch the contents of the tblEmp Table into a Recordset variable
Set rstTblEmp = CurrentDb().OpenRecordset("tblEmp", dbObenDynaset)
' Filter down our recordsetvariable to just include the employee in the Combo Box
strCriteria = "[LastName]='" & Me!cboLookup & "'"
rstTblEmp.FindFirst strCriteria
' Set our Form variables to the value of the first Record in our newly filtered Recordset. Note that if you have more than one employee with the same last name, it will ALWAYS show the first one that was entered into the tblEmp Table!
Me!tboFirstName = rstTblEmp("FirstName") ' First Name
Me!tboLastName = rstTblEmp("LastName") ' Last Name
Me!tboSalary = rstTblEmp("Salary") ' Salary