Private Sub UserForm_Initialize()
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'Permet de mettre un chiffres ID en fonction du dernier numéro dans la colonne A $
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Me.Label8.Caption = Application.WorksheetFunction.Max(Worksheets("BDD").Columns(1)) + 1
Dim I As Integer
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'EFFACEMENT DE TOUS LES CONTROLES DU FORMULAIRE $
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
For Each ctrl In userform1.Controls
If TypeOf ctrl Is MSForms.TextBox Or TypeOf ctrl Is MSForms.ComboBox Then
ctrl.Text = ""
ctrl.BackColor = vbWhite
ctrl.ForeColor = RGB(150, 150, 150)
ctrl.Font.Bold = True
End If
Next
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'REINITIALISATION DE TOUTES LES COMBOBOXES
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
'JE SUPPRIME CECI
' For I = ComboBox1.ListCount - 1 To 0 Step -1
' ComboBox1.RemoveItem (I)
'Next I
'For I = CbxCivilite.ListCount - 1 To 0 Step -1
'CbxCivilite.RemoveItem (I)
'Next I
'For I = CbxBoursier.ListCount - 1 To 0 Step -1
'CbxBoursier.RemoveItem (I)
'Next I
'For I = CbxMAssocie.ListCount - 1 To 0 Step -1
'CbxMAssocie.RemoveItem (I)
'Next I
'For I = CbxMembre.ListCount - 1 To 0 Step -1
'CbxMembre.RemoveItem (I)
'Next I
'PREINSCRIPTION EN GRIS SUR TEXTBOX2
'Me.TextBox2.Value = "Nom et Prénom"
'Me.TextBox3.Value = "N°, type de voie, nom de voie"
'---------------------------------------------------------------
'REMPLISSAGE COMBOBOX
'---------------------------------------------------------------
'userform1.CbxCivilite.AddItem "M."
'userform1.CbxCivilite.AddItem "Mme"
'userform1.CbxCivilite.AddItem "Mle"
'---------------------------------------------------------------
'REMPLISSAGE COMBOBOX
'---------------------------------------------------------------
'userform1.ComboBox1.AddItem "B"
'userform1.ComboBox1.AddItem "P"
'userform1.ComboBox1.AddItem "B/P"
'---------------------------------------------------------
'REMPLISSAGE COMBOBOX
'---------------------------------------------------------
'userform1.CbxBoursier.AddItem ""
'userform1.CbxMAssocie.AddItem ""
'userform1.CbxMembre.AddItem ""
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'QUE JE REMPLACE PAR CELA
Dim tabl, a&
With Me
mescombo = Array(ComboBox1, CbxCivilite, CbxBoursier, CbxMembre)
For I = 0 To UBound(mescombo): mescombo(I).Clear: Next
.CbxCivilite.List = Array("M.", "Mme", "Mle")
.ComboBox1.List = Array("B", "P", "B/P")
ReDim tabl(0 To (Year(Date) - 1956) + 1)
For u = Year(Date) To 1956 Step -1: a = a + 1: tabl(a) = "01/03/" & u: Next
.CbxBoursier.List = tabl
.CbxMAssocie.List = tabl
.CbxMembre.List = tabl
.TextBox19.Value = ""
.TextBox20.Value = ""
.TextBox21.Value = ""
.Label3.Caption = Date
.CbxCivilite.SetFocus
End With
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'For Each Ctrl In UserForm1.Controls
' If TypeOf Ctrl Is MSForms.TextBox Or TypeOf Ctrl Is MSForms.ComboBox Then
' Ctrl.Text = ""
' End If
'Next
End Sub