How to break operation of if else in vb6

Viewed 52

Hello i have this code in vb6 and i want the code to break operation if i click the cancel button but i cant seem to do it i searched online and found nothing, is it possible to do it? This is the code below:

if value <= temp then
    if (msgbox("Select an option", vbOKCANCEL + vbExclamation, MSG_TITLE) = vbCancel) Then
        'i want the code to break here and stop as it is to do nothing
    else
        'extra code
    end if
end if

Any idea how can i do that i think vb6 doesnt have BREAK as a function

1 Answers
if value <= temp then
    if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) = vbCancel Then
        ' Do nothing
    else
        ' extra code
    end if
end if
if value <= temp then
    if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) <> vbCancel Then
        ' extra code
    end if
end if
if value <= temp then
    if msgbox("Select an option", vbOkCancel Or vbExclamation, MSG_TITLE) = vbCancel Then
        Exit Sub
    else
        ' extra code
    end if
end if
Related