G
Guest
Hello -
I have the following type of code that checks controls to see that they're
filled in. I need to use it in several places. I need to put it into a Sub
that can just be called.
The problem is when I do that, it exits out of it's own sub if something
isn't filled in, but continues doing whatever is in the main sub it's in.
<snip>
txtCallerName.SetFocus
If txtCallerName.Text = "" Then
MsgBox "Please fill in the Caller Name!"
Exit Sub
End If
txtPhone.SetFocus
If txtPhone.Text = "" Then
MsgBox "Please fill in the phone number!"
Exit Sub
End If
<snip>
What's the best way to handle a situation like this?
Any help will be greatly appreciated!
I have the following type of code that checks controls to see that they're
filled in. I need to use it in several places. I need to put it into a Sub
that can just be called.
The problem is when I do that, it exits out of it's own sub if something
isn't filled in, but continues doing whatever is in the main sub it's in.
<snip>
txtCallerName.SetFocus
If txtCallerName.Text = "" Then
MsgBox "Please fill in the Caller Name!"
Exit Sub
End If
txtPhone.SetFocus
If txtPhone.Text = "" Then
MsgBox "Please fill in the phone number!"
Exit Sub
End If
<snip>
What's the best way to handle a situation like this?
Any help will be greatly appreciated!