[nateobot]
Registered User.
- Local time
- Yesterday, 23:25
- Joined
- Jul 15, 2002
- Messages
- 64
Hey I have a change password validation form. Standard setup with
OldPassword, NewPassword, ConfirmNewPassword.
In the underlying table the password field is limited to 10 characters. In the form I of course have the textboxes marked as password input mask. I would also like to limit the textbox to only accept 10 characters. I have code on the KeyPress event that seems to work however I was wondering if there was an easier way to do this?
my code for the keypress:
OldPassword, NewPassword, ConfirmNewPassword.
In the underlying table the password field is limited to 10 characters. In the form I of course have the textboxes marked as password input mask. I would also like to limit the textbox to only accept 10 characters. I have code on the KeyPress event that seems to work however I was wondering if there was an easier way to do this?
my code for the keypress:
Code:
Private Sub txtNewPass_KeyPress(KeyAscii As Integer)
If Not IsNull(txtNewPass.Text) Then
If Len(txtNewPass.Text) >= 9 Then
txtNewPass.Text = Left(txtNewPass.Value, 10)
End If
End If
End Sub