Solved

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

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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