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

commented: think before you post. -3

Thank you very much. Problem solved.

Please mark this thread as solved

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.