Bonsoir Dans un textbox, je souhaite que le troisième caractère saisi soit obligatoirement un 8 ou un 9 Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9" Then MsgBox "erreur"
lSteph
Bonjour,
Private Sub TextBox1_Change() Dim tst As Boolean tst = False If Len(TextBox1) >= 3 Then Select Case Mid(TextBox1, 3, 1) Case "8", "9" tst = True Case Else Application.EnableEvents = False TextBox1 = Left(TextBox1, 2) Application.EnableEvents = True MsgBox "le 3eme chr doit être 8 ou 9" End Select End If End Sub
'lSteph
On 18 sep, 13:46, PascalXLD wrote:
On 17 sep, 21:03, "Milan DESHAYES" wrote:
Bonsoir Dans un textbox, je souhaite que le troisième caractère saisi soit obligatoirement un 8 ou un 9 Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9" Then MsgBox "erreur"
Bonjour,
Private Sub TextBox1_Change()
Dim tst As Boolean
tst = False
If Len(TextBox1) >= 3 Then
Select Case Mid(TextBox1, 3, 1)
Case "8", "9"
tst = True
Case Else
Application.EnableEvents = False
TextBox1 = Left(TextBox1, 2)
Application.EnableEvents = True
MsgBox "le 3eme chr doit être 8 ou 9"
End Select
End If
End Sub
'lSteph
On 18 sep, 13:46, PascalXLD <pascalled...@hotmail.com> wrote:
On 17 sep, 21:03, "Milan DESHAYES" <mi...@club-internet.fr> wrote:
Bonsoir
Dans un textbox, je souhaite que le troisième caractère saisi soit
obligatoirement un 8 ou un 9
Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9"
Then MsgBox "erreur"
Private Sub TextBox1_Change() Dim tst As Boolean tst = False If Len(TextBox1) >= 3 Then Select Case Mid(TextBox1, 3, 1) Case "8", "9" tst = True Case Else Application.EnableEvents = False TextBox1 = Left(TextBox1, 2) Application.EnableEvents = True MsgBox "le 3eme chr doit être 8 ou 9" End Select End If End Sub
'lSteph
On 18 sep, 13:46, PascalXLD wrote:
On 17 sep, 21:03, "Milan DESHAYES" wrote:
Bonsoir Dans un textbox, je souhaite que le troisième caractère saisi soit obligatoirement un 8 ou un 9 Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9" Then MsgBox "erreur"
Milan DESHAYES
Parfait !!!!!!!!!
"lSteph" a écrit dans le message de news:
Bonjour,
Private Sub TextBox1_Change() Dim tst As Boolean tst = False If Len(TextBox1) >= 3 Then Select Case Mid(TextBox1, 3, 1) Case "8", "9" tst = True Case Else Application.EnableEvents = False TextBox1 = Left(TextBox1, 2) Application.EnableEvents = True MsgBox "le 3eme chr doit être 8 ou 9" End Select End If End Sub
'lSteph
On 18 sep, 13:46, PascalXLD wrote:
On 17 sep, 21:03, "Milan DESHAYES" wrote:
Bonsoir Dans un textbox, je souhaite que le troisième caractère saisi soit obligatoirement un 8 ou un 9 Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9" Then MsgBox "erreur"
Parfait !!!!!!!!!
"lSteph" <gmLSteph@gmail.com> a écrit dans le message de news:
1190117103.390199.214680@o80g2000hse.googlegroups.com...
Bonjour,
Private Sub TextBox1_Change()
Dim tst As Boolean
tst = False
If Len(TextBox1) >= 3 Then
Select Case Mid(TextBox1, 3, 1)
Case "8", "9"
tst = True
Case Else
Application.EnableEvents = False
TextBox1 = Left(TextBox1, 2)
Application.EnableEvents = True
MsgBox "le 3eme chr doit être 8 ou 9"
End Select
End If
End Sub
'lSteph
On 18 sep, 13:46, PascalXLD <pascalled...@hotmail.com> wrote:
On 17 sep, 21:03, "Milan DESHAYES" <mi...@club-internet.fr> wrote:
Bonsoir
Dans un textbox, je souhaite que le troisième caractère saisi soit
obligatoirement un 8 ou un 9
Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9"
Then MsgBox "erreur"
Private Sub TextBox1_Change() Dim tst As Boolean tst = False If Len(TextBox1) >= 3 Then Select Case Mid(TextBox1, 3, 1) Case "8", "9" tst = True Case Else Application.EnableEvents = False TextBox1 = Left(TextBox1, 2) Application.EnableEvents = True MsgBox "le 3eme chr doit être 8 ou 9" End Select End If End Sub
'lSteph
On 18 sep, 13:46, PascalXLD wrote:
On 17 sep, 21:03, "Milan DESHAYES" wrote:
Bonsoir Dans un textbox, je souhaite que le troisième caractère saisi soit obligatoirement un 8 ou un 9 Je vous remercie
Bonjour
Une petite piste
If Mid(Me.TextBox1, 3, 1) <> "8" And Mid(Me.TextBox1, 3, 1) <> "9" Then MsgBox "erreur"