Add a Password

  • Thread starter Thread starter Greg Staley
  • Start date Start date
G

Greg Staley

I would like to restrict access to a form in Access. Is there a way to do
this?

Greg
 
brandon said:
Greg,

You should use the security function of access. Create as
System.mdw file and copy it to common drive. Next have
each user of the database join the system.mdw file. You
can then create users and groups. Add the users to the
groups and restrict access to the form through your
security policy.

If you don't want to do this, then you should include a
security login procedure in the form_onload function. A
crude way of doing this would be as follows:

Private Sub Form_Load()
Dim sPassWord As String
Const sAccess = "Password"
sPassWord = InputBox("Please enter the password for
the form", "Login")

If sPassWord <> sAccess Then
DoCmd.Close acForm, "form Name", acSaveNo
End If
End Sub

I tried this, but any password, or even a blank enter works. I copied this
exactly like it is written here. I am just trying to keep the I D 10 Ts
from accessing a particular form, so nothing major is really necessary.
Any tips?

Greg
 
I tried this, but any password, or even a blank enter works. I copied this
exactly like it is written here. I am just trying to keep the I D 10 Ts
from accessing a particular form, so nothing major is really necessary.
 
Back
Top