1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub TxtEmail_BeforeUpdate(Cancel As Integer)
If (Me.TxtEmail <> "") Then
Dim res As Integer
res = Nz(DLookup("idclient", "tab_clients", "Email='" & Me.TxtEmail & "'"), 0)
If (res = txtIdClient) Then
Me.TxterreurEmail = ""
Me.BtnModifierClient = True
canceL = False ' tu as oublié le L, et aussi cette ligne est inutile : Cancel = False par défaut
Else
Me.TxterreurEmail = "Email deja utilisé,essayer un autre !"
Me.BtnModifierClient.Enabled = False
Me.TxtEmail.SelStart = 0 ' inutile
Me.TxtEmail.SelLength = Len(Me.TxtEmail.Value) ' inutile
Cancel = True
End If End If
End Sub |
Partager