Solved

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

Posted on 2014-09-29
3
712 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 36

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 50

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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 …

726 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