Solved Require minimum # of character in unbound field (2 Viewers)

donkey9972

Registered User.
Local time
Today, 13:15
Joined
May 18, 2008
Messages
42
Hi,

I have a form which does a password change using 2 unbound fields. I want the fields to require a minimum of 6 characters but I do not know if that is done in the validation rule or using VBA. Stupid me I tried to do it in the table it updates to, but since the fields are unbound... well it didn't work 😞.

I did try this on the fields on the form in the Validation Rule:
Code:
Len([CLM_no]) = 6

But it only gave me this error:

The expression [CLM_no] you entered in the form control's ValidationRule property contains the error The object doesn't contain the Automation object 'CLM_no.'.

Any help to point me in the right direction?
 
That will restrict you to exactly 6 characters.
If it's an unbound form then in the "Change Password" command button use something like

Code:
If Len(Me.MyNewPasswordControl) < 6 Then
  msgbox "The new password supplied is not long enough",vbInformation,"Check Password"
  Me.MyNewPasswordControl.SetFocus
  exit Sub
End if

Process the rest of the pasword update here....

Replace MyNewPasswordControl with the actual name of your New Password text box.
 
Use the builder to build the expression.
1731585138943.png
 
Thank you for the information Minty. Being limited to exactly 6 characters is a problem. I just wanted a minimum of 6 characters but up to as many as they want. I think I found something not requiring VBA that works.

Also thank you gasman, I build it and ended up using this
Code:
Len([txtPassword])>=6 Or Is Null

This way I can do the minimum I want and not limit it to just 6. This was solved, again thank you both.
 

Users who are viewing this thread

Back
Top Bottom