Second read example:




VERSION 5.00
Begin VB.Form frmRead2 
   Caption         =   "Read with EOF"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdExit 
      Caption         =   "Exit"
      Height          =   375
      Left            =   3120
      TabIndex        =   11
      Top             =   1800
      Width           =   735
   End
   Begin VB.CommandButton cmdRead 
      Caption         =   "Read"
      Height          =   375
      Left            =   360
      TabIndex        =   10
      Top             =   1800
      Width           =   735
   End
   Begin VB.TextBox txtNumCr 
      Height          =   285
      Left            =   2640
      TabIndex        =   9
      Top             =   1200
      Width           =   975
   End
   Begin VB.TextBox txtGPA 
      Height          =   285
      Left            =   2640
      TabIndex        =   7
      Top             =   840
      Width           =   975
   End
   Begin VB.TextBox txtMajor 
      Height          =   285
      Left            =   960
      TabIndex        =   5
      Top             =   840
      Width           =   615
   End
   Begin VB.TextBox txtName 
      Height          =   285
      Left            =   960
      TabIndex        =   3
      Top             =   480
      Width           =   2415
   End
   Begin VB.TextBox txtIdNo 
      Height          =   285
      Left            =   960
      TabIndex        =   1
      Top             =   120
      Width           =   855
   End
   Begin VB.Label lblNumCr 
      Caption         =   "# Credits"
      Height          =   255
      Left            =   1800
      TabIndex        =   8
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label lblGPA 
      Caption         =   "GPA"
      Height          =   255
      Left            =   1800
      TabIndex        =   6
      Top             =   840
      Width           =   495
   End
   Begin VB.Label lblMajor 
      Caption         =   "Major"
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   840
      Width           =   615
   End
   Begin VB.Label lblName 
      Caption         =   "Name"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   480
      Width           =   495
   End
   Begin VB.Label lblIdNo 
      Caption         =   "Id No"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   495
   End
End
Attribute VB_Name = "frmRead2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdExit_Click()
    Close #1
    End
End Sub

Private Sub cmdRead_Click()
    Dim IdNo As String, Name As String, Major As String, GPA As String, NumCr As String
    Dim Ans As String
    
    If EOF(1) Then
        Rem Ans = MsgBox("End of File Reached", vbOKOnly, "EOF")
        MsgBox "End of File Reached", vbOKOnly, "EOF"
        Rem END and Close here terminate the program
        Close #1
        End
    Else
        Input #1, IdNo, Name, Major, GPA, NumCr
        txtIdNo.Text = IdNo
        txtName.Text = Name
        txtMajor.Text = Major
        txtGPA.Text = GPA
        txtNumCr.Text = NumCr
    End If
End Sub

Private Sub Form_Load()
    Open "A:\StudentA" For Input As #1
End Sub