Results 1 to 4 of 4
  1. #1
    SamL is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Location
    NJ
    Posts
    20

    PW protecting a single form

    Hi, how do I require the user to enter a pw for a single form? All users of the database are entered into a table called tblProviders. There is a Boolean field in the table called Management. The users who have that field checked off may use the form called frmMgmtUseOnly by entering their initials. How do I get this this to be a reality? I have some code, but it's in the switchboard calling the form, and the users could get around the protection simply by opening the form in the side menu. This means that I have to have the code in the Open or Load event of the form itself. How do I do this?



    Thanks,
    Sam

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    The Open event can be canceled so use that event. You should simply do a dLooput to see if the current user is a manager (the boolean field is True) then use an input box to prompt for the password. Finally compare the entered value with the expected one and if different cancel the open event (
    Code:
    Cancel=True
    ).
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Users should not be able to access the navigation pane. Perhaps research how to secure an Access db (as much as that is possible). IMO your users table should have a field for user type, not a boolean for management only, then you would not be restricted to only 2 levels should you need more in the future. For forms that are restricted to a particular level, you can DLookup their level during form open event and cancel opening as mentioned. In fact, the form you open could prevent the ability to launch this form entirely, by restricting access to whatever it is you're using to do that (e.g. command buttons disabled or invisible).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    SamL is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2021
    Location
    NJ
    Posts
    20
    Great idea. Thanks.

    Sam

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Protecting a field with password
    By laqa in forum Security
    Replies: 7
    Last Post: 04-10-2018, 02:55 PM
  2. Access 2007 Protecting Integrity of DB
    By athyeh in forum Access
    Replies: 2
    Last Post: 07-24-2013, 12:11 PM
  3. Password protecting a table?
    By Celx in forum Security
    Replies: 2
    Last Post: 12-17-2011, 02:09 AM
  4. How protecting a mdb database ?
    By PaulL in forum Security
    Replies: 1
    Last Post: 01-14-2010, 04:43 PM
  5. Password protecting db
    By lmp101010 in forum Access
    Replies: 1
    Last Post: 12-20-2009, 03:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums