Solved

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

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

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
I've been an avid user and supporter of Malwarebytes Premium Version 2.x for years. It's an excellent product that runs alongside just about any Anti-Virus application without issues. It seems to have an uncanny ability to pick up many things that A…
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 the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now