sherlocked
Registered User.
- Local time
- Today, 12:00
- Joined
- Sep 22, 2014
- Messages
- 125
Experts,
I am attempting to populate an "EmpName" field in my datasheet view subform based on the code below. What is happening is that the fields are ALL changing to match the employee number of the most recently added row (see attached image).
Is there a way around this? Your assistance is appreciated as always.
I am attempting to populate an "EmpName" field in my datasheet view subform based on the code below. What is happening is that the fields are ALL changing to match the employee number of the most recently added row (see attached image).
Is there a way around this? Your assistance is appreciated as always.
Code:
Private Sub EmpNo_AfterUpdate()
Dim varEmpNo As String
Me.txtEmpName = DLookup("[eLName] & ', ' & [eFName]", "tblEmployees", "eEmpID = '" & varEmpNo & "'")
End Sub