Hi,
I have a code which runs a check. User inputs values into textboxes in inputform, then runs the check, and the msgbox is displayed. if msg is yes then program continues, else I want it to return to the input for to change values in textboxes. How can I do that?
Below is the code.

If (optanodespacing > 300) Then
                optanodespacing = 300
                Dim answerspc As Integer = MsgBox("Anode Spacing Must NOT Exceed 300m, Calculate Attenuation or use Optimum Anode Spacing, Do you want to continue?", vbExclamation + vbYesNo, "Confirm")
                If answerspc = vbYes Then
                Else
                    Return
                End If
            Else
                Dim answerspc As Integer = MsgBox("Anode Spacing is within limit, Do you want to continue?", vbExclamation + vbYesNo, "Confirm")
                If answerspc = vbYes Then
                Else
                    Return
                End If
            End If

You have logic mistake. Follow as below

Dim msgboxres As MsgBoxResult
msgboxres = MsgBox("this is a testing message!", vbYesNo)
If msgboxres = vbYes Then
MsgBox("vbYes clicked")
Else
MsgBox("vbnO cLICKED")

End If

Comments
think before you post.
This question has already been answered. Start a new discussion instead.