|
-
Sep 16th, 2000, 01:22 PM
#4
just try exit sub
If you want to ignore the message just put
"On error resume next" under whatever subroutine the error occurs
Like this:
Private Sub cmdCancel_Click()
On error resume next
Dim xVar As Integer
xVar = MsgBox("Are you sure you wish to cancel?", _
vbQuestion + vbYesNo)
If xVar = 6 Then
'-- cancel operation
Unload Me
End If
End Sub
Or you can go a step further and do this
Private Sub cmdCancel_Click()
On error goto getdahellouttahere
Dim xVar As Integer
xVar = MsgBox("Are you sure you wish to cancel?", _
vbQuestion + vbYesNo)
If xVar = 6 Then
'-- cancel operation
Unload Me
End If
getdahellouttahere:
exit sub
End Sub
but the most simple way would to just:
Private Sub cmdCancel_Click()
Dim xVar As Integer
xVar = MsgBox("Are you sure you wish to cancel?", _
vbQuestion + vbYesNo)
If xVar = 6 Then
'-- cancel operation
Unload Me <-----Replace this simply with "Exit Sub"
End If
End Sub
Have Phun
"There is more than one way to skin a cat"
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
|