Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
Merci a tous
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
Merci a tous
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
Merci a tous
Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" <spam@microsoft.com> a écrit dans le message de
news:Gszpf.1134$1Y4.74411@news20.bellglobal.com...
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" <clumb2@gratuit_en_anglais.fr.invalid> wrote in message
news:Ott6FfLBGHA.4084@TK2MSFTNGP12.phx.gbl...
Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" <spam@microsoft.com> a écrit dans le message de
news:Gszpf.1134$1Y4.74411@news20.bellglobal.com...
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis par
l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre de
fonction
Merci a tous
Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" wrote in message
news:CnCpf.797$%Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous
Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" <spam@microsoft.com> wrote in message
news:CnCpf.797$%N1.147196@news20.bellglobal.com...
Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" <clumb2@gratuit_en_anglais.fr.invalid> wrote in message
news:Ott6FfLBGHA.4084@TK2MSFTNGP12.phx.gbl...
Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" <spam@microsoft.com> a écrit dans le message de
news:Gszpf.1134$1Y4.74411@news20.bellglobal.com...
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous
Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" wrote in message
news:CnCpf.797$%Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous
Très bien.
Mais essayes ceci
Dans le Form_Load
Me.txtAgeCap.Tag = "l'age du Capitaine"
Me.cmbSexeMat.Tag = "le sexe du matelot"
Me.rchedNomCuistot = "le nom du cuisinier"
Dans AllOK
MsgBox "Vous n'avez pas fourni " & MyControl.Tag, vbInformation
Clive
John Smith wrote:Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" wrote in message
news:CnCpf.797$%Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous
Très bien.
Mais essayes ceci
Dans le Form_Load
Me.txtAgeCap.Tag = "l'age du Capitaine"
Me.cmbSexeMat.Tag = "le sexe du matelot"
Me.rchedNomCuistot = "le nom du cuisinier"
Dans AllOK
MsgBox "Vous n'avez pas fourni " & MyControl.Tag, vbInformation
Clive
John Smith wrote:
Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" <spam@microsoft.com> wrote in message
news:CnCpf.797$%N1.147196@news20.bellglobal.com...
Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" <clumb2@gratuit_en_anglais.fr.invalid> wrote in message
news:Ott6FfLBGHA.4084@TK2MSFTNGP12.phx.gbl...
Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" <spam@microsoft.com> a écrit dans le message de
news:Gszpf.1134$1Y4.74411@news20.bellglobal.com...
Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous
Très bien.
Mais essayes ceci
Dans le Form_Load
Me.txtAgeCap.Tag = "l'age du Capitaine"
Me.cmbSexeMat.Tag = "le sexe du matelot"
Me.rchedNomCuistot = "le nom du cuisinier"
Dans AllOK
MsgBox "Vous n'avez pas fourni " & MyControl.Tag, vbInformation
Clive
John Smith wrote:Re amélioré
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.Add "Text2"
strexclus.Add "Text4"
Debug.Print allok(strexclus, Form1)
End Sub
Function allok(exclus As Collection, frm As Form) As Boolean
Dim MyControl As Control
Dim y As Integer
Dim exclusyes As Boolean
allok = True
For Each MyControl In frm.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
exclusyes = False
Do
Debug.Print MyControl.Name & exclus.Item(y)
If MyControl.Name = exclus.Item(y) Then
exclusyes = True
Exit Do
End If
y = y + 1
Loop Until exclus.Count < y
Debug.Print MyControl.Name & exclusyes
If MyControl.Text = "" And exclusyes = False Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Function
End If
Case Else
End Select
Next
End Function
"John Smith" wrote in message
news:CnCpf.797$%Salut,
J'ai modifié un peu le code pour avoir un sub facilement utilisable
Je voudrais avoir votre avis...
Public allok as boolean
Sub allok1(exclus As Collection)
Dim MyControl As control
Dim y As Integer
allok = True
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
y = 1
Do
If MyControl.Text = "" And MyControl.Name <> exclus.item(y) Then
allok = False
MsgBox "Il manque des renseignements.", vbInformation
Exit Sub
End If
y = y + 1
If exclus.Count <= y Then Exit Do
Loop
Case Else
End Select
Next
End Sub
Private Sub Command1_Click()
Dim strexclus As New Collection
strexclus.add "Text7"
allok1 strexclus
If allok = False Then
Exit Sub
End If
end sub
"Clive Lumb" wrote in message
news:Essayer ceci (à mettre dans une procédure au niveau du form à
vérifier)
Dim MyControl As Control
For Each MyControl In Me.Controls
Select Case TypeName(MyControl)
Case Is = "MaskEdBox", "TextBox", "ComboBox"
If MyControl.Text = "" Then
MsgBox "Merci de renseigner " & MyControl.Name
End If
Case Else
End Select
Next
"John Smith" a écrit dans le message de
news:Gszpf.1134$Salut,
Je fais une appli genre interface pour une base de donnée. J'ai
plusieurs
form avec différent controle(textbox combobox maskedit...). Je veux
faire
une fonction pour m'assurer que tous les controles soient remplis
par l'utilisateur.
Je sais pas trop comment m'y prendre.
Est-ce que vous avez des idées ou avez -vous déjà écrit ce genre
de fonction
Merci a tous