I have created a table that has two forms based off of it - one form is for data entry, the other one is for recalling the data and potentially editing the entry. The problem occurs with the second form when I call up the data via a combo box; it will populate
all of the fields just fine the first time, but if I try to successively use the box to pull up additional entries it will overwrite the fields of the other entries with the data from the first entry.
Here is the code I am using for the combo box in the form:
Private Sub EmployeeID_AfterUpdate()
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "EmployeeID = " & Me!EmployeeID
Me.Bookmark = rst.Bookmark
Forms!frm_HourlyRatingEdit!Position = DLookup("Position", "dbo_Employees", "EmployeeID = Forms!frm_HourlyRatingEdit!EmployeeID")
Forms!frm_HourlyRatingEdit!txtFirstName = DLookup("FirstName", "dbo_Employees", "EmployeeID = Forms!frm_HourlyRatingEdit!EmployeeID")
Forms!frm_HourlyRatingEdit!txtLastName = DLookup("LastName", "dbo_Employees", "EmployeeID = Forms!frm_HourlyRatingEdit!EmployeeID")
Forms!frm_HourlyRatingEdit!Department = DLookup("Dept", "dbo_Employees", "EmployeeID = Forms!frm_HourlyRatingEdit!EmployeeID")
Forms!frm_HourlyRatingEdit!DateHire = DLookup("HireDate", "dbo_Employees", "EmployeeID = Forms!frm_HourlyRatingEdit!EmployeeID")
End Sub
What are some possible ways of fixing this?