Results 1 to 13 of 13

How to lock navigation pane with a password

  1. #1
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43

    How to lock navigation pane with a password


    Is there any way to lock the navigation pane in access preferably with a password.

  2. #2
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,337
    That's an odd thing to do. Its easy to hide/show the navigation pane in VBA. Will that serve your purpose?
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  3. #3
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43
    I have only little knowledge in VBA. Will you please give me the VBA code to lock the navigation pane in an accdr database. A lot of work I have done certainly with your esteemed help will be in vain if I can't lock the navigation pane and prevented others from changing the database objects I have created. Certainly there is a code for the purpose, but I am very poor in programming. If you sent me the code that will be great boon to me. Thanking you for the reply.

  4. #4
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,833
    .accdr does not display the navigation pane - and only a very limited ribbon. So can you clarify what you mean

  5. #5
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,337
    As already mentioned by Ajax, users won't see the navigation pane if using an ACCDR file or using the runtime version of Access.
    However if using the full version of Access, they could restore the nav pane by renaming the file as ACCDB or ACCDE.

    AFAIK you can't lock the navigation pane but you can remove it along with part or all of the ribbon.
    You can find code to do these in several of my example apps including this one http://www.mendipdatasystems.co.uk/c...ace/4594365418

    For greater security, there are lots of other things you can do to keep out all except the most determined hackers.
    For example, save as ACCDE, encrypt with a password and more. See http://www.mendipdatasystems.co.uk/i...ity/4594461803
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  6. #6
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43
    The accdr can easily converted as accde . My database is in accde. The code to lock the navigation pane evenif the accdr file converted as accde is needed.

  7. #7
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,833
    prevented others from changing the database objects I have created
    tables should be in the backend, so they cannot modify those, .accde will protect forms, reports and modules, which leaves queries. Since each user will have their own copy of the front end, the easiest way is to have some code that runs when the front end is opened which checks the name - and if it does not end with .accdr, it closes the app immediately

    Code:
    if right(currentdb.name,6)<>".accdr" then docmd.close
    Depends how secure you want to make your app - you can disable shortcut keys, password protect the back end, hide the linked tables (so users with full access cannot interrogate the tabledefs from another db to find the password), disable shift on open etc. Colin has most, if not all, these methods in his examples

  8. #8
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43
    Thank you for the reply.
    I used that code in the open event of the start up form. When changing the file extension accdr to accde or accdb that start up form is closed but the user can then access the access option and open the navigation pane . I changed that code as "docmd.close database". Then also the user can get time to open access option when the security dialog appeared in the screen.

    I am very poor in VBA hence you may please clarify how to use your code in my database successfully. Soliciting your esteemed help.

  9. #9
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    6,833
    the code didn't work because it never ran, so in hindsight not a good suggestion.

    You need to develop a security policy - what you want to protect, from whom, why and by what means. Colin has lots of suggestions in post #2.

  10. #10
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,337
    Agree with Ajax's point.
    Decide exactly what you need to do then look at examples such as those in my previous links for solutions.

    Use this amended code to close the database if file type changed
    Code:
    If Right(CurrentDb.Name,6)<>".accdr" Then Application.Quit
    Other things to do include
    1. Set the file location as trusted so the security warning isn't seen
    2. Remove the ribbon completely or remove parts of the File menu including Access Options
    3. Disable the shift bypass
    4. Hide the navigation pane
    There are other things as well but all the above will help a lot

    Also, to repeat, AFAIK, you cannot lock the navigation pane
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  11. #11
    sanal is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Feb 2018
    Posts
    43
    Thank you for a good reply. It works after converting the database to accde. But how to disable the shift bypass and remove the ribon . Will you help me with the code for the same .
    My ultimate aim is to prevent the users from changing the accdr file type by no means.
    Help me with the code to disable the shift key and remove the access option.Is there any other way to disable the start up option other than the shift key the code to prevent the same may also please be given.

  12. #12
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,337
    In Access options, untick the following in your ACCDB file (BUT make sure you keep an unsecured copy or you will lock yourself out):

    • Use Access special keys (disables shift bypass and various other keyboard shortcuts
    • Display Navigation Pane
    • Allow Full Menus - removes most of ribbon tabs
    • Allow Default Shortcut Menus - disable right clicking


    Strongly recommend users login (user name & password).
    If security matters that much, you should encrypt your database with a password.
    Although you'll need to tell users the password so they can get in, the encryption will prevent anyone reading your database in a text editor.
    See another article on my website: http://www.mendipdatasystems.co.uk/c...ity/4594444323
    In fact there are a lot of security related articles on the website - suggest you read the site map to see what there is

    You can find all code needed to manage the navigation pane, ribbon and application window in my example app - see link in post #5
    You want the modules modNavPaneTaskbar, modRibbon & modDatabaseWindow

    Try the example app and study how I've used the module code.
    Unless you understand the code and how/where to use it, you won't lock things down properly

    If you hide the ribbon completely, users will not be able to get to Access Options
    However, suggest you reinstate the Print Preview ribbon when users are viewing reports!

    Remake your ACCDE when you're done -don't forget about ensuring the location is trusted before users open the file for the first time

    You do need to be aware that no Access database can ever be made 100% secure from a determined and capable hacker with sufficient motivation to break into your app.
    All you can do is make it as hard as possible so they won't bother
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  13. #13
    isladogs's Avatar
    isladogs is offline Very intense programming
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,337
    Belated correction - it IS possible to partly lock the navigation pane using VBA though not with a password.
    This will prevent users deleting objects from the nav pane (but still be able to add new items

    Click image for larger version. 

Name:	LockedNavPane.PNG 
Views:	15 
Size:	16.2 KB 
ID:	37576

    If you want to know how to do so, send me a PM
    Unfortunately it is equally easy to unlock it again if you know how
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

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

Similar Threads

  1. Macro Lock Navigation Pane
    By MdHaziq in forum Security
    Replies: 2
    Last Post: 01-10-2018, 07:50 PM
  2. Replies: 2
    Last Post: 04-21-2013, 07:03 AM
  3. Navigation Pane
    By Patrick.Grant01 in forum Programming
    Replies: 11
    Last Post: 01-08-2013, 03:55 PM
  4. Navigation Pane Help Please...
    By Kristena in forum Programming
    Replies: 2
    Last Post: 01-13-2012, 02:03 PM
  5. Navigation Pane pain
    By Felmer Dingle in forum Access
    Replies: 0
    Last Post: 06-17-2010, 10:09 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
  •  
Tech Forums: Microsoft Office Forums