My if statement doesn't do the else part. There is something wrong with my rs.eof part of my if statement.
Code:
Private Sub Command19_Click()
Set rs = CurrentDb.OpenRecordset("SELECT * FROM CoachTable WHERE EmployeeID = '" & txtID & "'", dbOpenDynaset)
txtID = Forms![LoginForm2]![txtEmployeeID]
txtName = Forms![LoginForm2]![Text13]
If rs.EOF Then
txtName = DLookup("CoachName", "HourlyTable", "EmployeeID='" & txtID & "'")
Forms![LoginForm2]![Text13].SetFocus
Forms![LoginForm2]![Text13] = txtName
Else
txtName = DLookup("CoachName", "CoachTable", "EmployeeID='" & txtID & "'")
Forms![LoginForm2]![Text13].SetFocus
Forms![LoginForm2]![Text13] = txtName
End If
End Sub