Sauter un bloc d'instruction vers la fin

mohalesage -  
 Yoda -
Bonjour les amis,
je n'arrive pas à réussir une instruction donnée à mon application, qui consiste à aller vers l'actualisation des données si la réponse à la question est négative.
Pour plus de précision je vous expose mes codes :

If TDateSortie = "" Then

Reponse1 = MsgBox("S'agit il d'un sortant ?", vbCritical + vbExclamation + vbYesNo,
"Alors ! Que répondez vous ?")

TDateSortie.SetFocus

Exit Sub

End If

If Reponse1 = vbYes Then

TDateSortie.SetFocus

Else

?????????? ( je ne sais pas comment faire ignorer mon application si Reponse1= vbNo , d'aller directement à l'instruction d'actualisation )

Exit Sub

End If

Sachant que l'instruction d'actualisation est écrite comme suite :

If Not TDateSortie = "" Then RS![DSORTIE] = TDateSortie

RS.Update

Merci pour votre aide.

1 réponse

  1. Yoda
     
    Bonjour,

    Deux Conditions If imbriquées:

    If TDateSortie = "" Then 
       Reponse1 = MsgBox("S'agit il d'un sortant ?", vbCritical + vbExclamation +  vbYesNo, "Alors ! Que répondez vous ?") 
       If Reponse1 = vbYes Then 
          TDateSortie.SetFocus 
       Else 
          RS![DSORTIE] = TDateSortie 
          RS.UpdateExit
       End If 
    Else
       RS![DSORTIE] = TDateSortie 
       RS.Update 
    End If
    0