M
magicdds
I have a text box on a form where the user can enter their password. I have
the following code to not allow the user to continue typing more than 4
letters into the text box:
Private Sub Password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Len(Password.Text) = 0 Then KeyCode = 0
If Len(Password.Text) <> 4 Then KeyCode = 0
End If
End Sub
---------------------------------------------------------------
Private Sub Password_KeyPress(KeyAscii As Integer)
If Len(Password.Text) >= 4 Then
If KeyAscii <> vbKeyBack Then
KeyAscii = 0
Beep
End If
End If
End Sub
This all worked fine. But, now that it works, I changed the Input Mask of
the PASSWORD text box to Password, and I get an error message:
"Microsoft Access can't retrieve the value of the property Len(Password.Text)"
Does anyone have an idea of how to solve this problem?
Thanks
Mark
the following code to not allow the user to continue typing more than 4
letters into the text box:
Private Sub Password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Len(Password.Text) = 0 Then KeyCode = 0
If Len(Password.Text) <> 4 Then KeyCode = 0
End If
End Sub
---------------------------------------------------------------
Private Sub Password_KeyPress(KeyAscii As Integer)
If Len(Password.Text) >= 4 Then
If KeyAscii <> vbKeyBack Then
KeyAscii = 0
Beep
End If
End If
End Sub
This all worked fine. But, now that it works, I changed the Input Mask of
the PASSWORD text box to Password, and I get an error message:
"Microsoft Access can't retrieve the value of the property Len(Password.Text)"
Does anyone have an idea of how to solve this problem?
Thanks
Mark