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
| Private Sub Cmd_FicheEleve_Click()
Dim stDocName As String
If IsNull(Me.Cadre9) Then
MsgBox "Attention Cochez une case", vbExclamation, "Attention"
Me.Cadre9.SetFocus
End If
If Cadre9.Value = 1 Then
If IsNull(Me.Num) Then
MsgBox "Attention Saisissez le N_Exam", vbExclamation, "Attention"
Me.Num.SetFocus
ElseIf DCount("Num", "R_Eleves") = 0 Then
MsgBox "Aucun enregistrement !", vbExclamation
Cancel = True
ElseIf IsNull(DLookup("[N_Exam]", "R_Eleves", "[N_Exam]=" & Me.Num & "")) Then
MsgBox "Vérifier le Numéro N_Exam Saisi !", vbExclamation
Cancel = True
Else
DoCmd.OpenReport "E_Eleves", acPreview, , "N_Exam= " & Me.Num & ""
End If
End If
If Cadre9.Value = 2 Then
If IsNull(Me.Num) Then
MsgBox "Attention Saisissez le Numéro National", vbExclamation, "Attention"
Me.Num.SetFocus
ElseIf DCount("Num", "R_Eleves") = 0 Then
MsgBox "Aucun enregistrement !", vbExclamation
Cancel = True
ElseIf IsNull(DLookup("[N_Etab]", "R_Eleves", "[N_Etab]='" & Me.Num & "'")) Then
MsgBox "Vérifier le N_Etab Saisi !", vbExclamation
Cancel = True
Else
DoCmd.OpenReport "E_Eleves", acPreview, , "N_Etab= '" & Me.Num & "'"
End If
End If
If Cadre9.Value = 3 Then
If IsNull(Me.Num) Then
MsgBox "Attention Saisissez le Numéro D'examen Correcte", vbExclamation, "Attention"
Me.Num.SetFocus
ElseIf DCount("Num", "R_Eleves") = 0 Then
MsgBox "Aucun enregistrement !", vbExclamation
Cancel = True
ElseIf IsNull(DLookup("[N_Eleve]", "R_Eleves", "[N_Eleve]=" & Me.Num & "")) Then
MsgBox "Vérifier le N_Eleve Saisi !", vbExclamation
Cancel = True
Else
DoCmd.OpenReport "E_Eleves", acPreview, , "N_Eleve= " & Me.Num & ""
End If
End If
End Sub |
Partager