Results 1 to 12 of 12
  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

    Cannot open database app in "bypass" mode

    I'm not sure what it is called, but I frequently bypass the security and start up settings in Access applications by holding down the shift key. Been doing it for years and hardly think about it. I've been working on one app for months and had no problem with this method till now. I hold down the Shift key and the app boots up and locks down the security and menus anyway. My only choices are Home tab and the File tab which only has privacy options and Exit. Well, I just found out Privacy Options would allow me to Allow Full Menus and Display Navigation Pane. So I found a way in to edit my app, but this seems mighty clumsy and why the heck did this happen?



    It's 5 o'clock here so I'm going home. I'll check back in the morning.

    Paul

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Isnt holding shift just opening it as administrator? perhaps try the right click and open as admin and see if that works.

  3. #3
    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 see that option.

  4. #4
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    maybe try this.

    Permanently run a program as an administrator

    • Navigate to the program folder of the program you want to run. ...
    • Right-click the program icon (the .exe file).
    • Choose Properties.
    • On the Compatibility tab, select the Run This Program As An Administrator option.
    • Click OK.
    • If you see a User Account Control prompt, accept it.


  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Make sure no code is in the OnOpen or OnLoad of that first form that prevents the shift key. Just for info, in the past, I have put code in to disallow the shift key part, but put a small box under my title on the first splash screen that comes up. I can double click on this box and it disables the code and allows me to use the shift key again. The box is small and same color as the background so does not show(have to know where it is). Probably better ways to do it these days....

  6. #6
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    *******************************************Edit*** ***********************************
    Comment Removed. Not sure how to delete it.
    ************************************************** **********************************

  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
    Andy,

    Followed your instructions. When I tried to open the database I got this. The database is on a network drive.

    "Microsoft Access can't find the following file. \\abc0101\myfolder\mydatabase.accdb I've tried opening it from Access and double clicking directly on the accdb file.

    Funny thing just happened. I unchecked the Run This Program As An Administrator option and now it is working. Go figure. Thanks for your help. In a roundabout way it fixed the problem, I hope. I'm feeling a bit snakebit at the moment.

  8. #8
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I find that worse myself. When you fix a problem but don't know how it bugs me haha. Glad you fixed it anyways mate.

    its possible that you are using mapped drives to your network? sometimes these paths need to be reset. (I'm no expert in networking). This happens to our server sometimes and in "my computer" under "this pc" drop down. this is where the mapped location will be it would have a little red x there.

    If this happens you can go into it from my computer and it resets it. Often I cant follow shortcuts on my desktop because of this.

  9. #9
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Spoke too soon. Either I was opening the wrong copy (I have too many versions) or something else, but the file in question is still locked up pretty tight. I hate not knowing. I've already done a compact and repair. My next step will be importing all the objects and modules into a new database, if I can. It's a mapped drive, but this was never an issue before. Stay tuned.

  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
    Well, the import worked and the database performed as expected, for awhile. I tested it 3 or 4 times and the 4th time it went back to its old bad behavior. I'm beginning to think this is an Access thing and I need to have it reinstalled. I've been using Access 2010 for about five years now and have never seen anything like this happen.

    Bulzie, could you post your code that you used in your invisible box. I don't want to have to go into Options and keep resetting the defaults.

  11. #11
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    This run when first form opens to disable the shift key.
    Private Sub Form_Open(Cancel As Integer)
    ChangeProperty "AllowBypassKey", dbBoolean, False
    End Sub

    This is the label box, you double click the box, then exit the program, then use shift to open. Sometimes it takes 2 times doing this.

    Private Sub Label41_DblClick(Cancel As Integer)
    ChangeProperty "AllowBypassKey", dbBoolean, True
    End Sub


    This is the function to manipulate the Property


    Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
    Dim dbs As Object, prp As Variant
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err
    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

    Change_Bye:
    Exit Function

    Change_Err:
    If Err = conPropNotFoundError Then ' Property not found.
    Set prp = dbs.CreateProperty(strPropName, _
    varPropType, varPropValue)
    dbs.Properties.Append prp
    Resume Next
    Else
    ' Unknown error.
    ChangeProperty = False
    Resume Change_Bye
    End If
    End Function

    Might be better ways to do it with later Access versions, this code is pretty old but still works.

  12. #12
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Aaahh, after extensive searches on Bing trying to learn more about database properties and getting nowhere, I see how your code works and what might be wrong with my database. There is no visible place that I could find to set the property "AllowByPassKey". Somehow is must be getting turned off, because I see after I run your code, I can close and reopen the database with the shift key down and it works. Something happens when I close the application using the Quit button to set it back to false.

    and I found out what it was.

    Code:
    Public Function SetStartOption()
    
    If GetFacCode() = "720" Then
             Call SetStartUpOptions("AllowBypassKey", dbBoolean, True)
          Else: Call SetStartUpOptions("AllowBypassKey", dbBoolean, False)
    End If
    End Function
    This explains why when I use "720" as a FacCode, this does not happen. I never quite understood what this was doing until now. Mystery solved!

    Thank you for your assistance.

    Paul

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 04-08-2014, 09:36 AM
  2. Replies: 4
    Last Post: 11-05-2013, 03:46 PM
  3. Replies: 1
    Last Post: 04-12-2013, 07:56 AM
  4. Replies: 1
    Last Post: 10-26-2012, 12:52 PM
  5. File Names in "Open Recent Database" list
    By Ron.Sul in forum Access
    Replies: 3
    Last Post: 12-29-2011, 10:06 AM

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