Dear all,

I hope that you can help me with a vb.net problem.
In my program the user chooses multiple options.
When a group of options is given, than the program wil check if the user has give the right start and end value.
See the code below

                If Me.cboA.SelectedIndex = 2 And Me.cboB.SelectedIndex = 1 And cboC.SelectedIndex = 3 Then
                    If Eind - Start < 270.0 Then
                        Me.txtEnd.Clear()
                        Me.txtEnd.Focus()
                    ElseIf End - Start > 270.0 Then
                        Me.txtStart.Clear()
                        Me.txtStart.Focus()
                    End If
                End If
                End = Me.txtEnd.Text

I want the program to do this:
When the difference between end and start is not 270, then the textbox txtEnd must be empty and focus.
The procedure must stop, because the right value has to be given so that the difference is 270.

I can get to empty the txtEnd and set focus, but hte procedure will continue.
I want it to stop (better pauze) so that the user can give the right value.

Thanx in advance.

Sneaky Pete

Recommended Answers

All 2 Replies

use

Exit Sub

Great,

Thanx. It's so simple!
I lost focus in the code, haha.

Thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.