Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

How to Remove Shift in Access 2007

104 4

    Disabling the Shift Key for Access Projects (.adp file)

    • 1). Open Access.

    • 2). Open your project file by going to "File," then "Open."

    • 3). Press the "ALT" key and the "F11" key on your keyboard. This will open up the "Visual Basic Editor."

    • 4). Click "View," then "Immediate Window."

    • 5). Type the following code, provided by Microsoft, in the "Immediate Window:"

      CurrentProject.Properties.Add "AllowBypassKey", False

      Hit "Enter."

    • 6). Close the editor.

    • 7). Save your work and restart Access.

    Disabling the Shift Key for Access Database (.mdb or .accdb files)

    • 1). Open Access.

    • 2). Create a new module by going to "Objects," then "Modules" in the "Database" window.

    • 3). Add this function, provided by Microsoft, into the module:

      Function ap_DisableShift()

      'This function disable the shift at startup. This action causes

      'the Autoexec macro and Startup properties to always be executed.

      On Error GoTo errDisableShift

      Dim db As DAO.Database

      Dim prop as DAO.Property

      Const conPropNotFound = 3270

      Set db = CurrentDb()

      'This next line disables the shift key on startup.

      db.Properties("AllowByPassKey") = False

      'The function is successful.

      Exit Function

      errDisableShift:

      'The first part of this error routine creates the "AllowByPassKey

      'property if it does not exist.

      If Err = conPropNotFound Then

      Set prop = db.CreateProperty("AllowByPassKey", _

      dbBoolean, False)

      db.Properties.Append prop

      Resume Next

      Else

      MsgBox "Function 'ap_DisableShift' did not complete successfully."

      Exit Function

      End If

      End Function

    • 4). Add this second function immediately after the one you inserted into the last step:

      Function ap_EnableShift()

      'This function enables the SHIFT key at startup. This action causes

      'the Autoexec macro and the Startup properties to be bypassed

      'if the user holds down the SHIFT key when the user opens the database.

      On Error GoTo errEnableShift

      Dim db as DAO.Database

      Dim prop as DAO.Property

      Const conPropNotFound = 3270

      Set db = CurrentDb()

      'This next line of code disables the SHIFT key on startup.

      db.Properties("AllowByPassKey") = True

      'function successful

      Exit Function

      errEnableShift:

      'The first part of this error routine creates the "AllowByPassKey

      'property if it does not exist.

      If Err = conPropNotFound Then

      Set prop = db.CreateProperty("AllowByPassKey", _

      dbBoolean, True)

      db.Properties.Append prop

      Resume Next

      Else

      MsgBox "Function 'ap_DisableShift' did not complete successfully."

      Exit Function

      End If

      End Function

    • 5). Open the Visual Basic Editor by pressing the "ALT" key and the "F11" keys on your keyboard again.

    • 6). Click "View," then "Immediate Window."

    • 7). Type "ap_DisableShift" in the "Immediate Window" to disable the use of the "Shift" key.

Source...

Leave A Reply

Your email address will not be published.