1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Private Sub bt_CloseForm_Click()
DoCmd.GoToRecord , , acFirst
txt_SejourError.Value = ""
If txt_DebutSejour.Value = "" Or IsNull(txt_DebutSejour) Then
MsgBox "La date du début du séjour de " & txt_IdClient.Value & " doit être renseignée.", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errdebut"
txt_DebutSejour.SetFocus
Exit Sub
End If
If txt_finSejour.Value = "" Or IsNull(txt_finSejour) Then
MsgBox "La date de la fin du séjour de " & txt_IdClient.Value & " doit être renseignée.", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errfin"
txt_finSejour.SetFocus
Exit Sub
End If
If txt_finSejour.Value - txt_DebutSejour.Value < 1 Then
MsgBox "Les dates de début et de fin du séjour de " & txt_IdClient.Value & " sont incompatibles." & vbCr & "Un séjour dure, au moins, une nuit." & vbCr & vbCr & "Vérifiez et corrigez.", vbCritical, " Erreur sur les dates de séjour."
txt_SejourError.Value = "errdates"
txt_RmkSejour.SetFocus
Exit Sub
End If
If lt_StatutSejour.Value = "Séjour annulé" And (txt_RmkSejour.Value = "" Or IsNull(txt_RmkSejour)) Then
MsgBox "Si le séjour de " & txt_IdClient.Value & " est annulé, indiquez les conditions de l'annulation dans le champ ''Remarques''", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errAnnul"
txt_RmkSejour.SetFocus
Exit Sub
End If
SuIvant:
On Error GoTo ErRe
DoCmd.GoToRecord , , acNext
txt_SejourError.Value = ""
If txt_DebutSejour.Value = "" Or IsNull(txt_DebutSejour) Then
MsgBox "La date du début du séjour de " & txt_IdClient.Value & " doit être renseignée.", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errdebut"
txt_DebutSejour.SetFocus
Exit Sub
End If
If txt_finSejour.Value = "" Or IsNull(txt_finSejour) Then
MsgBox "La date de la fin du séjour de " & txt_IdClient.Value & " doit être renseignée.", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errfin"
txt_finSejour.SetFocus
Exit Sub
End If
If txt_finSejour.Value - txt_DebutSejour.Value < 1 Then
MsgBox "Les dates de début et de fin du séjour de " & txt_IdClient.Value & " sont incompatibles." & vbCr & "Un séjour dure, au moins, une nuit." & vbCr & vbCr & "Vérifiez et corrigez.", vbCritical, " Erreur sur les dates de séjour."
txt_SejourError.Value = "errdates"
txt_finSejour.SetFocus
Exit Sub
End If
If lt_StatutSejour.Value = "Séjour annulé" And (txt_RmkSejour.Value = "" Or IsNull(txt_RmkSejour)) Then
MsgBox "Si le séjour de " & txt_IdClient.Value & " est annulé, indiquez les conditions de l'annulation dans le champ ''Remarques''", vbCritical, "Saisie manquante."
txt_SejourError.Value = "errAnnul"
txt_RmkSejour.SetFocus
Exit Sub
End If
GoTo SuIvant
ErRe:
DoCmd.Close
End Sub |
Partager