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
| Function Test_rempli() As Boolean
Dim n%
Test_rempli = False
For n = 1 To 19
If Me.Controls("TextBox" & n) = "" Then
Test_rempli = False
Exit For
Else
Test_rempli = True
End If
Next n
End Function
Function Test_blanc() As Boolean
Dim n%
Test_blanc = False
For n = 4 To 12
If Me.Controls("TextBox" & n).BackColor = RGB(255, 255, 255) Then
Test_blanc = True
Exit For
Else
Test_blanc = False
End If
Next n
End Function
Function Test_rouge() As Boolean
Test_rouge = False
If TextBox4.BackColor = RGB(204, 0, 0) Or _
TextBox5.BackColor = RGB(204, 0, 0) Or _
TextBox6.BackColor = RGB(204, 0, 0) Or _
TextBox7.BackColor = RGB(204, 0, 0) Or _
TextBox8.BackColor = RGB(204, 0, 0) Or _
TextBox9.BackColor = RGB(204, 0, 0) Or _
TextBox10.BackColor = RGB(204, 0, 0) Or _
TextBox11.BackColor = RGB(204, 0, 0) Or _
TextBox12.BackColor = RGB(204, 0, 0) Then
Test_rouge = True
Else
Test_rouge = False
End If
End Function
Sub BoutonActif()
If Test_rempli = True And Test_blanc = True Then
Me.Image1.Visible = True
Me.Image3.Visible = False
Me.Image4.Visible = False
Me.Label69.Caption = "Envoyez la requête"
ElseIf Test_rempli = True And Test_rouge = True Then
Me.Image1.Visible = False
Me.Image3.Visible = True
Me.Image4.Visible = True
Me.Label69.Caption = "Besoin d'une validation du Chef d'équipe"
Else
Me.Image1.Visible = False
Me.Image1.Visible = False
Me.Image1.Visible = False
Me.Label69.Caption = "Renseignez tous les champs"
End If
End Sub |
Partager