Results 1 to 15 of 15
  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 MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    That's an odd thing to do. Its easy to hide/show the navigation pane in VBA. Will that serve your purpose?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    .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 MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    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, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    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 MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    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, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  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 MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    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, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    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:	45 
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, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    imtiaz786 is offline Novice
    Windows 8 Access 2016
    Join Date
    Aug 2020
    Posts
    1
    If Right(CurrentDb.Name,6)<>".accdr" Then Application.Quit

    sir j ye code kha likhe. plz help

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by imtiaz786 View Post
    If Right(CurrentDb.Name,6)<>".accdr" Then Application.Quit

    sir j ye code kha likhe. plz help
    @Imtiaz786
    Do you have a question about the use of that code?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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