j'ai fais une petite application pour l'enregistrement des membres d'une structure.
en faite j'aimerai aller en plusieurs étape
la première est limité à 25 membres
mon problème est la suivante:
j'aimerai que une fois les 25 membres sont atteint, s'affiche un message de ce genre
nombre limite d'enregistrement atteint
si nécessaire, voir le codage suivant
Private [/contents/446-fichier-sub Sub] CommandButton1_Click()
Sheets("Base de donnée").Activate
Dim Insuv As Integer
Insuv = [A25].End(xlUp).Row + 1
Dim I As Integer
For I = 1 To Insuv
If TextBox1.Text = "" Then
[/contents/1176-vbscript-les-boites-de-dialogue MsgBox] "Veuillez remplis les champs de saisis", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Cells(I, 1).Text = TextBox1.Text Then MsgBox "Ce code est déjà attribué à " & Cells(I, 3).Value: TextBox1.Text = "": TextBox1.SetFocus: Exit Sub
Next I
If Me.ComboBox1 = "" Then
MsgBox "Veuillez renseigner la lettre alphabetique", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox2 = "" Then
MsgBox "Veuillez renseigner le nom", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox3 = "" Then
MsgBox "Veuillez renseigner la date de naissance", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox6 = "" Then
MsgBox "Veuillez renseigner le lieu de naissance", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox7 = "" Then
MsgBox "Veuillez renseigner le N° CNI OU Extrait", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox8 = "" Then
MsgBox "Veuillez renseigner la ville d'origine", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox9 = "" Then
MsgBox "Veuillez renseigner le lieu de residence", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.ComboBox2 = "" Then
MsgBox "Veuillez renseigner la situation matrimoniale", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox15 = "" Then
MsgBox "Veuillez renseigner le nombre d'enfant", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox16 = "" Then
MsgBox "Veuillez renseigner la date de conversion", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox19 = "" Then
MsgBox "Veuillez renseigner le lieu de conversion", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox20 = "" Then
MsgBox "Veuillez renseigner le lieu de culte", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.ComboBox3 = "" Then
MsgBox "Veuillez renseigner la situation de baptême", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox26 = "" Then
MsgBox "Veuillez renseigner la proffetion dans l'église", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox27 = "" Then
MsgBox "Veuillez renseigner la proffetion sociale", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
If Me.TextBox29 = "" Then
MsgBox "Veuillez renseigner le N° célulaire", ok, "Copiryght Inocent Koffi.2017-IC MEMBERS V-1.0":
Exit Sub
End If
Cells(Insuv, 1) = TextBox1.Text
Cells(Insuv, 3) = TextBox2.Text
If TextBox3 <> "" Then
Cells(Insuv, 4) = DateValue(TextBox3.Value & "/" & TextBox4.Value & "/" & TextBox5.Value)
Else
Cells(Insuv, 4) = ""
End If
Cells(Insuv, 5) = TextBox6.Text
Cells(Insuv, 6) = TextBox7.Text
Cells(Insuv, 7) = TextBox8.Text
Cells(Insuv, 8) = TextBox9.Text
Cells(Insuv, 10) = TextBox10.Text
If TextBox11 <> "" Then
Cells(Insuv, 11) = DateValue(TextBox11.Value & "/" & TextBox12.Value & "/" & TextBox13.Value)
Else
Cells(Insuv, 11) = ""
End If
Cells(Insuv, 12) = TextBox14.Text
Cells(Insuv, 13) = TextBox15.Text
If TextBox16 <> "" Then
Cells(Insuv, 14) = DateValue(TextBox16.Value & "/" & TextBox17.Value & "/" & TextBox18.Value)
Else
Cells(Insuv, 14) = ""
End If
Cells(Insuv, 15) = TextBox19.Text
Cells(Insuv, 16) = TextBox20.Text
If TextBox21 <> "" Then
Cells(Insuv, 18) = DateValue(TextBox21.Value & "/" & TextBox22.Value & "/" & TextBox23.Value)
Else
Cells(Insuv, 18) = ""
End If
Cells(Insuv, 19) = TextBox24.Text
Cells(Insuv, 20) = TextBox25.Text
Cells(Insuv, 21) = TextBox26.Text
Cells(Insuv, 22) = TextBox27.Text
Cells(Insuv, 23) = TextBox28.Text
Cells(Insuv, 24) = TextBox29.Text
Cells(Insuv, 25) = TextBox30.Text
Cells(Insuv, 2) = ComboBox1.Text
Cells(Insuv, 9) = ComboBox2.Text
Cells(Insuv, 17) = ComboBox3.Text
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
TextBox16.Text = ""
TextBox17.Text = ""
TextBox18.Text = ""
TextBox19.Text = ""
TextBox20.Text = ""
TextBox21.Text = ""
TextBox22.Text = ""
TextBox23.Text = ""
TextBox24.Text = ""
TextBox25.Text = ""
TextBox26.Text = ""
TextBox27.Text = ""
TextBox28.Text = ""
TextBox29.Text = ""
TextBox30.Text = ""
Me.Image1.Picture = Nothing
TextBox1.SetFocus
MsgBox "Enregistrement ok"
Exit Sub
End Sub
merci d'avance à tous
A voir également:
Afficher un msgbox quand la valeur de la Base est atteinte
Private sub CommandButton1_Click()
If WorksheetFunction.CountBlank(Range("A1:A25")) = 0 Then
MsgBox "Attention: nombre limite membres atteint!"
Exit Sub
End If
End sub
merci
mais un petit soucis stp
je met ou?
j'ai éssayer ça mais çia n'affiche pas le message
STP situe moi
À mettre après la ligne qui active la feuille