I am using a MDI Form and several documents can be opened using
"CommonDialog1.ShowOpen"
If i open a file then go back to open another file but click cancel or the "x" then it will open the last file.
so i need to know how to clear the "#1"
my code it:
FileName = ""
Data = ""
MDIForm1.CommonDialog1.Filter = "All Files(*.*)|*.*|Text Files(*.txt)|*.txt|Web Files(*.html;*.htm;*.shtml;*.shtm;*.xhtml;*.php;*.php3;*.phtml;*.css;*.js;)|*.html;*.htm;*.shtml;*.shtm;*.xhtml;*.php;*.php3;*.phtml;*.css;*.js;|Batch Files(*.bat;*.cmd;*.nt;)|*.bat;*.cmd;*.nt;|VB Files(*.vb;*.vbs;*.frm;*.vbp;)|*.vb;*.vbs;*.frm;*.vbp;"
On Error GoTo error
MDIForm1.CommonDialog1.ShowOpen
Me.Caption = MDIForm1.CommonDialog1.FileTitle
FileName = MDIForm1.CommonDialog1.FileName
Open FileName For Input As #1
Do Until EOF(1)
Input #1, Data
Me.Text1.Text = Me.Text1.Text + Data + vbCrLf
EOF (1)
Loop
Close #1
FileName = ""
Data = ""
GoTo endload
Any ideas
I have cleared the "FileName" and "Data" but it still does it so i need to find a way to stop it.