I want to know how to stop a VB code when an something happens in an 'if' statement
[code]If Not (password1 = password2) Then 'Checking for matching passwords
Me.Errors.Text = "passwords do not match."
'I want the code to stop here but all I know is that it is "break;" in JAVA
End If
[/code]
If you want the function to terminate simple type return;
Sometimes you can use break, or exit, depends on the language not sure about visual basic.
Since I'm no expert I'll assume this just doesn't work
In that case, you have to use 2 equals signs
(probably)
(don't stab me please)
Thanks! as soon as I read it I remembered that it was 'Return' from class :D
thank you <3
[QUOTE=Murkrow;28409657]Since I'm no expert I'll assume this just doesn't work
In that case, you have to use 2 equals signs
(probably)
(don't stab me please)[/QUOTE]
-stab - :3
Call a function stop_right_there_you_criminal_scum()
[code]
Exit Sub ' Exits the sub you are in
Return ' exits the function
break ' exists a loop (for, while, until, etc.)
Application.exit() ' kills the whole thing
[/code]
Sorry, you need to Log In to post a reply to this thread.