Password Protected Forms

  • Thread starter Thread starter Jim/Chris
  • Start date Start date
J

Jim/Chris

Another way of protecting forms is to restrict access by
username. Here is what I have used. Watchout for the
wordwrap.

If CurrentUser = "userid1" Or CurrentUser = "userid2" Or
CurrentUser = "Admin" Or CurrentUser = "userid3" _
Or CurrentUser = "userid4" Then
stDocName = "name of form"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
Baduser = "Sorry ... you're not authorized to access that
item."
MsgBox Baduser
End If

Jim/Chris
 
-----Original Message-----
Another way of protecting forms is to restrict access by
username. Here is what I have used. Watchout for the
wordwrap.

If CurrentUser = "userid1" Or CurrentUser = "userid2" Or
CurrentUser = "Admin" Or CurrentUser = "userid3" _
Or CurrentUser = "userid4" Then
stDocName = "name of form"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
Baduser = "Sorry ... you're not authorized to access that
item."
MsgBox Baduser
End If

Jim/Chris
.
You could use a simple startup form with option buttons
to click on that will take the user to the desired form
provided they know the password. When clicked, a message
box appears prompting for a password. If the entered info
doesn't equal the password you specify in your VBA code,
then entry to that form isn't allowed. Tons of ways to
get around this, (as with almost any password system) if
the user is dedicated to doing such. Also, requires a
little VBA knowledge as to Event Procedures and what to
put in them.

Or you could use DLookup and compare the inputted password
to a password contained in a company profile table for
that form. Just a few general ideas.
 
Back
Top