Hello
I have an UNBOUND textbox Text1 that I want to validate in code.
I want to lock the user into the field until Valid Data is entered.
I created the following Function:
Private Function Validate(MyControl As Control) As Boolean
If Len([Text1]) < 6 Then
MsgBox "Password too small"
' Etc..Etc.......
Validate = True
Else
Validate=False
End If
End Function
I tried each of the following INDIVIDUALLY and ran into problems:
Validation Rule =Validate([Text1])
'Keeps evaluating as True, despite the function running properly.
On Change =Validate([Text1])
'Evaluates character by character. Not good here.
Before Update =Validate([Text1])
'Evaluates fine, but allows the user to leave the field in error
AfterUpdate =Validate([Text1])
'Evaluates fine, but allows the user to leave the field in error
I want to validate at the control not the form level, and I want
to evaluate in a custom coded function as shown.
Any Advice ???