|
-
Dec 2nd, 2002, 10:59 PM
#1
Thread Starter
Addicted Member
Break from SUB?? SIMPLE??
hi..
i have
Private sub something_click()
If Trim(txtCustomerName.Text) = "" Then
msgbox "Customer name required.", vbCritical, "Required"
***
End If
^other code here^
^other code here^
^other code here^
^other code here^
^other code here^
End Sub
where the *** are i want to stop executing the code the ^other code here^
...like just break out of the subroutine, how do i do that? isn't there a break or something?
sorry, i'm used to java, which has a break statement, anything equivalent in VB?
--770
-
Dec 2nd, 2002, 11:04 PM
#2
Member
Try Exit Sub, I think that's all you need in that place precisely ( where the * * * )
-
Dec 2nd, 2002, 11:04 PM
#3
Use Exit
Exit For
Exit Loop
Exit Sub
Exit Function
Exit Property
Etc (If there are any more)
Exit Sub is the one you'll want to use.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|