Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Check password for key criteria

Rob Evans

Recommended Posts


I need to require each of 30 staff to create a password to access his/her individual schedule file. I want each password to be six characters total and to contain:

• at least one number

• at least one UPPER CASE LETTER

• at least one lower case letter

• at least one non-alphanumeric character

I'm trying to create a script that will check to see that the password a staff member creates meets these criteria. All be working on the same Mac (not through FM Server) running OS 10.6 and using FMP 11.

Thanks in advance for any help.

Rob Evans

Link to comment
Share on other sites

I will assume that you will start with a PasswordEntry field:


Use this calculation for a ValidPasswordEntry =


Let (



Lcaps = Length (Filter (PasswordEntry; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")) ;

Llow = Length (Filter (PasswordEntry; "abcdefghijklmnopqrstuvwxyz")) ;

Lnum = Length (Filter (PasswordEntry; "0123456789" )) ;

Lchar = Length (Filter (PasswordEntry; "!@#$%^&*()" )) ;




Case ( Lcaps * Llow * Lnum * Lchar > 0 ; "True" ; "False")



Link to comment
Share on other sites

Set them up with a front-end file that has a default account name and password plus one record per person. Make them search for their own record by information that other people would presumably not have, like their middle name, mother's middle name, social security number, and license plate number. Create two global fields, g.Password and g.PasswordConfirm and a button that runs a script that pops them up in a custom dialog (allow field entry, using password ••••••• characters) and use If / End If to confirm that g.Password matches g.PasswordConfirm and that Length (Filter (g.Password, "0123456789")>0 and not Exact (Lower (g.Password); g.Password) and not Exact (Upper (g.Password); g.Password) and Length (Filter (g.Password, "0123456789abcdefghijklmnopqrstuvwxyz≠") ≠ Length (g.Password). If it passes all those tests, run a subscript that is set to execute with full access privileges which calls a script in the main file with script parameters Account Name (which you get from the person's record) and Password (which they chose for themselves).


The script in the main file executes the Create Account script step with the appropriate privilege set, using the account name and password passed to it; the script itself executes will full access privileges. Then, having done so, it closes the file and the front-end file. Now the user can log in with the account they just created.

Link to comment
Share on other sites


  • Create New...

Important Information

Terms of Use