|
-
Aug 13th, 2004, 07:41 AM
#1
Thread Starter
PowerPoster
Errors[resolved]
Ok i'm trying to trap the incorrect path error but this code allways displays the error evan if the image is loaded!
VB Code:
Private Sub CmdLoad_Click()
On Error GoTo handler:
OriginPic.Cls
OriginPic.Picture = LoadPicture(txtPath.Text)
OriginPic.Refresh
handler: MsgBox "Please Make sure Path IS Correct"
End Sub
Last edited by Pino; Aug 13th, 2004 at 07:56 AM.
-
Aug 13th, 2004, 07:52 AM
#2
Exit Sub right before the handler label
-
Aug 13th, 2004, 07:52 AM
#3
Hyperactive Member
Pino,
it's a too basic error... sorry... 
VB Code:
Private Sub CmdLoad_Click()
On Error GoTo handler:
OriginPic.Cls
OriginPic.Picture = LoadPicture(txtPath.Text)
OriginPic.Refresh
[b]exit sub[/b] '<--- it's missing...
handler: MsgBox "Please Make sure Path IS Correct"
End Sub
JL
-
Aug 13th, 2004, 07:55 AM
#4
Thread Starter
PowerPoster
your right that was too basic, i think its time i left the computer alone for a bit thanks guys
-
Aug 13th, 2004, 07:56 AM
#5
And for multi error handling...
VB Code:
On Error Goto Sample1
'blah blah
On Error Goto Sample2
'blah blah
Exit Sub/Function
Sample1:
'handle
'Err.Clear
Exit Sub/Function
Sample2
'handle
'Err.Clear
Exit Sub/Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|