Log in Form

Title

Log in Form

Post

Hello,

For my database, how would I create a form to be used as a log in? I understand I need a script that displays the login screen when the database is opened, but how do I create the password? I only require a password, no usernames.

However, the easier thing to do is setup under File > Manage > Security two different accounts. "Admin" which has full rights (including design changes) and "User" (use any name that you then share with anyone) and assign it the Data Entry Only privilege set. Give the Admin account a password and the User account a different password. You give the user account information to everyone else, but they cannot make changes to the structure of the database. The user then supplies the user name and password to login.

OR

You can do it your way in the following manner:

Create a table for Globals (using global storage)

Create a field for "LoginPassword" on the Global Table

Create an opening script

In the opening script use the "Show Custom Dialog Box" script step, give it a title and instruction text.

Use the second tab for "Input Fields" and specify input field #1 is to be stored in the global field (you can even check the box to "use password character".

Use an IF statement to test if the inputted value in the global field equals the password you want. If the password DOES NOT match, show a dialog box showing the error and then use the "Exit Application" step to close. If the password does match, the IF statement does not return TRUE and the steps between "IF" and "END IF" are skipped.

The problem with the second method though is that everyone that logs in has Admin privileges so they can make changes to table design, relationships, and layouts - something that can be very, very bad.

However, the easier thing to do is setup under File > Manage > Security two different accounts. "Admin" which has full rights (including design changes) and "User" (use any name that you then share with anyone) and assign it the Data Entry Only privilege set. Give the Admin account a password and the User account a different password. You give the user account information to everyone else, but they cannot make changes to the structure of the database. The user then supplies the user name and password to login.

OR

You can do it your way in the following manner:

Create a table for Globals (using global storage)

Create a field for "LoginPassword" on the Global Table

Create an opening script

In the opening script use the "Show Custom Dialog Box" script step, give it a title and instruction text.

Use the second tab for "Input Fields" and specify input field #1 is to be stored in the global field (you can even check the box to "use password character".

Use an IF statement to test if the inputted value in the global field equals the password you want. If the password DOES NOT match, show a dialog box showing the error and then use the "Exit Application" step to close. If the password does match, the IF statement does not return TRUE and the steps between "IF" and "END IF" are skipped.

The problem with the second method though is that everyone that logs in has Admin privileges so they can make changes to table design, relationships, and layouts - something that can be very, very bad.