Question

  • Creator
    Topic
  • #2146049

    Disable the AllowByPassKey

    Locked

    by sabine.nelis ·

    Hi,

    I’m working on a database with 2000 file format in access 2007 and wants to disable the AllowBypassKey to secure my database. When this key is not disabled users can start up the database holding the shift key. I’ve tried to do what is on this link http://www.mvps.org/access/general/gen0040.htm
    but i can’t let it work. Can anyone help me?
    Sabine

All Answers

  • Author
    Replies
    • #2564641

      Clarifications

      by sabine.nelis ·

      In reply to Disable the AllowByPassKey

      Clarifications

    • #2564617

      Disabling the AllowByPassKey.

      by Anonymous ·

      In reply to Disable the AllowByPassKey

      To set the AllowBypassKey property to False, follow these
      steps:

      Start Access.

      Open an Access database project.

      In the Database window, point to Macro on the Tools menu,
      and then click Visual Basic Editor.

      In the Visual Basic Editor, click Immediate Window on the
      View menu.

      Type the following code or paste the following code in the
      Immediate window, and then press
      ENTER.CurrentProject.Properties.Add “AllowBypassKey”, False

      Close the Visual Basic Editor, and then close the Access
      database project.

      Open the Access database project. Try to bypass the
      startup options that are set for the Access database
      project by holding down the SHIFT key while you open the
      Access database project.

      The functionality of the SHIFT key that permits you to
      bypass the startup option is disabled. Although you hold
      down the SHIFT key to bypass the startup options, the
      startup options are executed. You cannot bypass the
      startup options.
      ……………………………………..
      OR
      Create form with to command buttons
      1st. ShowDatabase
      with following code:
      Private Sub ShowDatabase_Click()
      CurrentDb.Properties(“AllowBypassKey”) = True
      End Sub

      2nd. HideDatabase
      Private Sub HideDatabase_Click()
      CurrentDb.Properties(“AllowBypassKey”) = False
      End Sub

      Both of these are as you can see on click events.
      And then assign security to this form so only
      administrator would have rights to it. And then place it
      on switchboard. This way you can toggle between hiding database window and showing it as you please. That way if
      you are not running full menus in db you can still make changes later and you are not locked out. Thanks to Amir for this.

      Please post back if you have any more problems or questions.

      • #2564376

        Disabling the AllowByPassKey.

        by sabine.nelis ·

        In reply to Disabling the AllowByPassKey.

        Hello,

        Thanks for your answer, but I got error on performing following step :
        CurrentProject.Properties.Add “AllowBypassKey”, False
        Error : 449 (The argument is not optional)

        How do I resolve this problem.
        Can you help me?

        Thanks in advance
        Sabine

        • #2564373

          Check out this link

          by rob miners ·

          In reply to Disabling the AllowByPassKey.

        • #2564364

          no clue

          by sabine.nelis ·

          In reply to Check out this link

          Sorry,

          No clue. I understand the error, but not why. Just tried to follow the instructions mentioned by Peconet.

          Sabine

        • #2564361

          I thought that it might be something like this mind you I am not 100% sure

          by rob miners ·

          In reply to no clue

          If you execute Test1 directly you will get the error #449 “Argument is
          not optional” [look for “debugging Basic programs” in the Help index].
          Test1 declares a parameter named aString, of type String; this means it
          *expects* you to pass a string argument when you call it. If you just
          run it, you will get the error “Argument is not optional” because you
          are not passing the expected argument, in fact you are not passing any
          argument at all. So “Argument is not optional” means you *must* pass an
          argument when you call it, as the parameter is not declared to be
          *Optional*.

        • #2564358

          Disable AllowBypassKey

          by sabine.nelis ·

          In reply to I thought that it might be something like this mind you I am not 100% sure

          hi,

          another problem. In the Immediate window I type : CurrentProject.Properties.Add “AllowBypassKey”, False

          and ENTER
          gives next line

          then I type : CurrentDb.Properties(“AllowBypassKey”) = False

          and i get the error : 3270 (Property not found). I thought I’ve just added it to my properties collection.

          Don’t understand one thing about it.
          Can anyone explain this to me!

          Sabine

          sabine

        • #2563356

          So the first

          by rob miners ·

          In reply to Disable AllowBypassKey

          part is working Sabine and now there is another problem. I am not a scripter, I have only been playing around with it. Do as I have been doing and Google the Error Codes that is how I have managed to get by in the past.

          http://msdn.microsoft.com/en-us/library/aa140020(office.10).aspx

          http://msdn.microsoft.com/en-us/library/aa195906(office.11).aspx

        • #2563355

          Did you try the second part i had put in there?

          by Anonymous ·

          In reply to Disabling the AllowByPassKey.

          Go to my earlier post with the full page, scroll down until you see “OR”, then try that info.

          Please post back if you have any more problems or questions.

      • #2564952

        Disabling the AllowByPassKey

        by sabine.nelis ·

        In reply to Disabling the AllowByPassKey.

        Hi,

        Thanks for your reply.

        Did everything you mentioned before, but it doesn’t work.
        When I type : CurrentDb.Properties(“AllowBypassKey”) = False in the immediate window, I get an error 3270 (Property not found).
        I’ve created a form ‘test’ with 2 command buttons like you told me to. Made this the display form in the applications options of the current database. When I toggle, nothing is happening. Still can use the Shift Key. Made also a switchboard ‘hide/show database’ with a button that opens the form ‘test’. Nothing happens.
        Really don’t know want I’m doing wrong.

        Hope you can help me through this.

        Thanks in advance,
        Sabine

Viewing 1 reply thread