I have a text file in the following format:
lastname
firstname
middlename
employeenumber
hiredate
etc...
I have a combo box with a dropdown of all the employee names.
When you select a name, it opens the correct text file and should pull in the information.
I am getting a runtime error 62
Input past end of file
Here is my code:
Private Sub EmployeeName_AfterUpdate()
Dim Line1, Line2, Line3
Open "c:\attendance\name.txt" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, Line1 ' Read line into variable.
Line Input #1, Line2
Line Input #1, Line3
Loop
Close #1 ' Close file.
Me.[LastName] = Line1 ' Update fields
Me.[FirstName] = Line2
Me.[MiddleName] = Line3
End Sub
lastname
firstname
middlename
employeenumber
hiredate
etc...
I have a combo box with a dropdown of all the employee names.
When you select a name, it opens the correct text file and should pull in the information.
I am getting a runtime error 62
Input past end of file
Here is my code:
Private Sub EmployeeName_AfterUpdate()
Dim Line1, Line2, Line3
Open "c:\attendance\name.txt" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, Line1 ' Read line into variable.
Line Input #1, Line2
Line Input #1, Line3
Loop
Close #1 ' Close file.
Me.[LastName] = Line1 ' Update fields
Me.[FirstName] = Line2
Me.[MiddleName] = Line3
End Sub