Your code is missing something:
Code:
Private Sub Command2_Click()
Open "yob.dat" For Input As #1
'Opens the file given by the user.
Do Until EOF(1)
'Does this loop until End Of File(EOF) for file number
Line Input #1, Data
'Read one line and puts it into the varible Data.
'Adds the read line into Text1.
'It was missing this line:
Text1.Text = Text1.Text & vbCrLf
Loop
Close #1
End Sub
Also, don't use 1 for FileNumber, because the FileNumber canbe taken (if you have more then 1 file opened), instead you can get the next available FileNumber by using FreeFile function.
Code:
Dim iFFN As Integer
iFFN = FreeFile
Open "C:\MyFile.txt" For Input as iFFN
'Read the file
Close #iFFN