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
|
Public Modif As Boolean, Ajout As Boolean, Suppr As Boolean
Option Compare Database
Private Function Autoris()
Me.AllowEdits = Modif
Me.AllowAdditions = Ajoute
Me.AllowDeletions = Suppr
Private Sub Form_Current()
' DoEvents
' Rouge
Modif = False
Ajout = False
Suppr = False
' Autoris
End Sub
Private Function Rouge()
Me.Nouveau.BackColor = RGB(255, 0, 0)
Me.Modifier.BackColor = RGB(255, 0, 0)
Me.Supprimer.BackColor = RGB(255, 0, 0)
End Function
Private Sub Nouveau_Click()
Rouge
Me.Nouveau.BackColor = RGB(0, 255, 0)
Me.DataMode = acFormEdit
End Sub
Private Sub Modifier_Click()
' On Error GoTo Err
Rouge
If Me.AllowEdits = False Then
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True
' Modif = True
' Autoris
Me.Modifier.BackColor = RGB(0, 255, 0) ' vert
MsgBox "Fait"
Else
MsgBox "Je Ferme"
Occupé = False
DoCmd.Close
End If
' GoTo 0
'Err:
' MsgBox " Erreur"
End Sub
Private Sub Supprimer_Click()
Rouge
Me.Supprimer.BackColor = RGB(0, 255, 0)
End Sub
Private Sub Annuler_Click()
Rouge
DoCmd.Close
End Sub
Private Sub Form_Close()
Dim Oc As String
Occupé = False
If Occupé Then Oc = "O" Else Oc = "L"
MsgBox "Je Ferme" + " " + Oc
Forms("Post-it").SetFocus
End Sub |
Partager