setting up switchboard

5

5StarMom

I am setting up a database for an employment agency. I want to allow
applicants to type their information in a form but restrict them from
accessing company information. I have a switchboard that divides the
application from the private information. Can I put some kind of "lock" in
place, either through macros or VBA that will prevent them from going into
"private" information without a password?
 
T

Tom van Stiphout

On Thu, 2 Apr 2009 16:00:55 -0700, 5StarMom

Here is one option:
Create a global variable in a standard module:
dim g_blnIsLoggedIn as boolean
Global variables are False by default.

Create a form, opened from the switchboard, to ask for the password.
If it is correct, set this global variable.
const ThePassword = "secret"
if Me.txtPassword = ThePassword then
g_blnIsLoggedIn = True
end if

In the Form_Open of every form except the applicant form write:
Cancel = not g_blnIsLoggedIn
This cancels opening the form if user is not logged in.

Depending on your needs you may also want to explicitly logout when
the applicant form is opened:
In the Form_Open:
g_blnIsLoggedIn = False

-Tom.
Microsoft Access MVP
 
Y

Yecenia

If you split the data and give the employees the "front end" which links to
only the tables you need them to update, that will help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top