Setting passwords

  • Thread starter Thread starter Nmex Ron
  • Start date Start date
N

Nmex Ron

I would like to set a password for a database in Access 2007, and also set an
additional (or different) password for a particular form and table that
contain financial data, that I don't want all users to use.
Is this possible? If so can someone please provide details.

Thanks
Ron
 
On Fri, 4 Jan 2008 12:07:03 -0800, Nmex Ron

If you're using the MDB format you could use workgroup security. But
unlike what some marketing materials may lead you to believe this is
an advanced topic and I don't recommend it for novices.

If you are using the new ACCDB format you have to program security
yourself. The simplest way I can think of (works both in MDB and
ACCDB) is this one-liner in the Form_Open event:
Cancel = (InputBox("Give password:") <> "MySecretPassword")

-Tom.
 
Tom van Stipout,

Thanks for the quick reply -- almost sounds to easy.
Some follow up questions:
How do I set the password? How can I change it? Can I put a user name on
this?

Thanks again.
Ron
-----------------------------
 
Tom,
I tried putting Cancel = (InputBox("Give password:") <> "MySecretPassword")
into the On Open event of the form. I get an error message that says: ...
can’t find the object.
I take it I am suppose to create a form or macro. A07 help gives no
reference to a "Input Box".

Would you please provide more details -- i.e How to create the form or
other, and do I have the correct event field?
---------------------------------------------
 
On Sat, 5 Jan 2008 09:26:01 -0800, Nmex Ron

You need to open the code window behind the form, and select the Form
Open procedure. Then paste in my one-liner.

Note also that InputBox is written without a space, and it IS in the
help file (at least in the VBA help file (code window > F1).

-Tom.
 
Tom,

Works like a charm --Thanks much!

Ron
-------------------------------------------------
 
Is there a way I can allow the user to set a new password?
Also, how can I not have the typed text for the password show in the InputBox?

I appreciate your help.
Thanks,
Ron
-------------------------------------
 
Back
Top