Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Article by: btan
Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
Transferring data across the virtual world became simpler but protecting it is becoming a real security challenge.  How to approach cyber security  in today's business world!
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 …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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

13 Experts available now in Live!

Get 1:1 Help Now