Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Toggle AllowByPassKey Property

    I have a dilemma. I want the AllowByPassKey property to be false when I distribute a Accde Front End. I have set this value in the immediate window using this:


    Code:
    CurrentProject.Properties.Add "AllowBypassKey", False
    Then I close and reopen the database holding the Shift key down and it still allows the bypass. I went back to the Immediate window and check to see what the value of the AllowByPassKey property was and it return a 0.
    Code:
    ?CurrentProject.Properties("AllowBypassKey").Value  
    0
    which tells me Access remembered the value I gave it, but still allowed me to use it.

    I also want to be able to turn this back on at my option, but this is not relevant till I am able to switch it off. For this experiment I have unchecked Display Navigation Pane which also displays when I hold down the shift key. I want this value to be set to false before any forms are opened.

    I've even tried something like this in the default forms OnLoad event, but this accomplishes nothing.

    Code:
        
        If gblAgencyCode = "720" Then
            CurrentProject.Properties.("AllowBypassKey") = True
        Else
            CurrentProject.Properties.("AllowBypassKey") = False
        End If

    I'm getting nowhere fast. Please show me the error of my ways.

    Thanks in advance,

    Paul

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Paul,

    I have not used these but you may get ideas from

    SB Manage

    and/or ShiftBypass

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Why not set it manually? Create the accde in the development folder, then set the options, then distribute it.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Code here http://www.databasedev.co.uk/disable_shift_bypass.html worked for me (had to fix typos in the MsgBox concatenation - missing quote marks).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Thanks, be back tomorrow to browse through my options.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I also want to be able to turn this back on at my option
    Where? If each user is getting their own FE, why would you want them to be able to do that to their copy? Your comment suggests you are sharing a single FE across all users and you'd want to be able to bypass the startup routine to check something about the design of that FE. I wouldn't use a button that everyone can see for cycling the property.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Everyone will have their own Front End. I just want hide everything and keeping nosy people poking around in the Navigation Pane. I know I can set that property in Current DB settings, but they can get around it be using the Shift key.

  8. #8
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I've dug myself into a hole again. Somehow I turned Allow Bypass Key to False and it worked. Now I can't turn it back to True.
    I came up with this small bit of code which I thought would work. The message boxes are just for confirmation. and they seem to work. I click Yes, the vbYes code runs and returns a -1, but when I close and reopen the database I still can't open in Bypass mode. Totally frustrated and about to walk away from the whole concept.

    Code:
    Private Sub cmdBPK_Click()
    
        If MsgBox("Yes/No", vbYesNo) = vbYes Then
            CurrentProject.Properties.Add "AllowBypassKey", True
            MsgBox CurrentProject.Properties("AllowBypassKey").Value
        Else
            CurrentProject.Properties.Add "AllowBypassKey", False
            MsgBox CurrentProject.Properties("AllowBypassKey").Value
        End If
        
    End Sub
    Paul

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You try code from posted link? It works for me.

    If users 'poking around' is an issue then provide them accde version.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I place on giving them the Accde version, but I don't think that will keep them out of the tables.

    I looked at the code you pointed me at. It worked at first, then very strange things started happening. Break points stopped working and then I peppered the code with message boxes and even they didn't pop up. I finally cooked the code down to the example above which seems like it should work. Whatever I did I couldn't reset the default back to allowing the bypass key.

    It not a have to have, but something I like to have in my pocket just in case.

    I'll try to forget about it over a long weekend.

    Thanks for your help.

    Paul

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Not even disabling shift key bypass will keep a committed meddler out of the tables if they know where the backend file is located.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    AFAIC, the only way to keep most people out of the be tables is to link the be with a password. Yes, I know the most committed hackers can see the password IF they can see the nav pane, but the idea is to use various parts together; i.e. hide nav pane, distribute accde or mde, bypass, password the links and disable short cut menus and keys.
    The only way I know how to alter the bypass when "locked" out in that matter is to do it from another db. If you want the code for this post back and I'll look it up.

  13. #13
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I don't think we have any "committed meddlers". I just to discourage an average user from nosing around where he or she doesn't belong. I'd seen it done elsewhere and thought it might come in handy.

  14. #14
    GcDog60 is offline Novice
    Windows 11 Office 365
    Join Date
    Jan 2024
    Posts
    1
    Quote Originally Posted by Paul H View Post
    I have a dilemma. I want the AllowByPassKey property to be false when I distribute a Accde Front End. I have set this value in the immediate window using this:
    Code:
    CurrentProject.Properties.Add "AllowBypassKey", False
    Then I close and reopen the database holding the Shift key down and it still allows the bypass. I went back to the Immediate window and check to see what the value of the AllowByPassKey property was and it return a 0.
    Code:
    ?CurrentProject.Properties("AllowBypassKey").Value  
    0
    which tells me Access remembered the value I gave it, but still allowed me to use it.

    I also want to be able to turn this back on at my option, but this is not relevant till I am able to switch it off. For this experiment I have unchecked Display Navigation Pane which also displays when I hold down the shift key. I want this value to be set to false before any forms are opened.

    I've even tried something like this in the default forms OnLoad event, but this accomplishes nothing.

    Code:
        
        If gblAgencyCode = "720" Then
            CurrentProject.Properties.("AllowBypassKey") = True
        Else
            CurrentProject.Properties.("AllowBypassKey") = False
        End If

    I'm getting nowhere fast. Please show me the error of my ways.

    Thanks in advance,

    Paul



    It appears that you would need to 'add' the property to the autoexec macro's property collection; first .

    MS has a good example of how to set this up:

    https://support.microsoft.com/en-us/...5-b0f1deac517b

  15. #15
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    See if these articles help
    Improve Access Security 2 (isladogs.co.uk)
    Manage the Shift Bypass Property (isladogs.co.uk)
    Each article is one in a series of three related articles
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Toggle Button
    By gheyman in forum Access
    Replies: 2
    Last Post: 07-11-2017, 07:43 AM
  2. Create Property for AllowBypassKey
    By robbeh in forum Programming
    Replies: 2
    Last Post: 11-11-2014, 03:56 PM
  3. Toggle a criteria on and off?
    By overlords in forum Queries
    Replies: 11
    Last Post: 03-31-2013, 03:20 PM
  4. Toggle Button Help
    By dbalilti in forum Access
    Replies: 1
    Last Post: 07-05-2012, 04:23 AM
  5. How to use "Securing AllowBypassKey" code
    By ped in forum Programming
    Replies: 0
    Last Post: 12-30-2011, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums