I'm new to VB programming. I'm using Visual Basic Professional Version 5 and running Windows XP Professional. I'm having trouble with an error 401 when I run my compiled program. The error message says,"Can't show non-modal form when modal form is displayed."
I've written a small, primative text editor and it runs perfectly in run time. However, after I compiled it and ran the '.exe' program and try to open a '.txt' file into the editor, I get the error 401 message.
The program opens form1 (splash screen) then hides it and opens form2 (text editor) then the code to open a file is:
Quote:
Private Sub mnuOpen_Click()
Dim LengthOfFile As Integer
On Error GoTo ErrHandler
cd1Text.Filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt"
cd1Text.FilterIndex = 2
cd1Text.ShowOpen
Open cd1Text.filename For Input As #1
LengthOfFile = LOF(1)
txtTextEditor.Text = Input(LengthOfFile, 1)
Close #1
FlagTextChanged = False
Exit Sub
ErrHandler:
If Err.Number = 53 Then
MsgBox "Error In Path/FileName"
Exit Sub
ElseIf Err.Number = 32755 Then
Exit Sub
Else
MsgBox "Unanticipated Error # " & Err.Number
End
End If
End Sub
|
Does anyone have any ideas?