Solved

AllowBypass key not working to prevent users from using SHIFT key to open database

Posted on 2014-09-29
3
703 Views
Last Modified: 2014-09-29
Hello:

I am ready to put my Access program into production.  When I do, I want only the default Access form to appear when the application launches on the network.  The ShowToolbar code below works; therefore, anyone else going into the Access application will not see the navigation objects on the left or the toolbar icons/buttons/commands on the top.  This is good; however as many of you know, when you hold the SHIFT key down and launch the Access database application, it "bypasses" the startup options and displays the navigation and toolbar - things I don't want the users to see and possibily accidentally access.

I Googled and found that setting AllowByPass = False would prevent the start up from displaying everything other than the form itself.  Nothing so far seems to work in keeping these items "hidden" if a user were to hold the SHIFT key and launch the application.  I'm using Access 2010 and ADO.  The code, which is located in the Form_Open is shown below:  (strUserNameLogin is already established earlier in the Form_Open event and the File --> Options --> Current Database --> Display form is set to the form I want opened when the Access application launches.

If strUserNameLogin = "jef0155" Then    (My computer account login)
      DoCmd.ShowToolbar "Ribbon", acToolbarNo   (should be Yeswhen ready to go)

      DoCmd.ShowToolbar "Status Bar", acToolbarNo   (should be Yeswhen ready to go)

      DoCmd.NavigateTo "acNavigationCategoryObjectType"
      DoCmd.RunCommand acCmdWindowHide
      CurrentProject.Properties.Add "AllowBypassKey", False  (should be True when ready to go)
   Else
      DoCmd.ShowToolbar "Ribbon", acToolbarNo
      DoCmd.ShowToolbar "Status Bar", acToolbarNo
      DoCmd.NavigateTo "acNavigationCategoryObjectType"
      DoCmd.RunCommand acCmdWindowHide
      CurrentProject.Properties.Add "AllowBypassKey", False
   End If

Am I missing something?  Any help and suggestions would be greatly appreciated.
0
Comment
Question by:HRISTeam
3 Comments
 
LVL 35

Assisted Solution

by:PatHartman
PatHartman earned 250 total points
ID: 40350138
Compile the app to an .accde and then rename to .accdr.  although renaming the app doesn't add any security (user can simply rename to .accde), it does prevent the navigation pane and most ribbons from displaying.  You also loose the right-click menu.  So, test carefully to make sure the user still has what he needs.  Also, since you are compiling to .accde which will prevent anyone from poking around in the code, you MUST, ABSOLUTELY MUST, back up the .accdb to a secure location since that is still your master and you can't change anything without going back to it.
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 40350240
Regarding the AllowBypass method - you cannot set it in the same "session" of your application execution. Using the methods you're showing, the AllowBypass method would be enacted on the NEXT time your application was opened - not in the current "session".

So you'd first set the AllowBypass = FAlse, and then deploy it to your end user. When those users open it and try to hold down the Shift key, they would not be allowed to see the menus.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 40350315
Good catch Scott. I didn't imagine that line was included in the posted code.

/gustav
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question