Ok, I have a file listbox and and a multiline textbox and i want a text file to go into the textbox, but some of the files I click on are too big and it shows the Runtime error 62
Input past end of file message. I wanted to be able to make it show my own error message, but it shows my error message on everything now, wether there is an error or not. here is my code:
[code]
Private Sub File1_Click()
On Error GoTo Ermsg
Open File1.Path & "\" & File1.FileName For Input As #1
Text1.Text = Input(LOF(1), 1)
Close #1
Ermsg:
On Error Resume Next
If MsgBox("Error, Either the file you have selected is too big or is corrupted. Please select another.", vbCritical, "Error!") = vbOK Then Beep
End Sub
What it wrong?
[Edited by HoSs on 05-07-2000 at 01:34 PM]




Reply With Quote