You are on page 1of 3

Bypass Shiftkey Password - SharePoint Hill

Search this site

Home Contact Us Tutorials SharePoint Access Excel Google SQL Server Dynamics CRM GoToMeeting

Tutorials > Access >

Bypass Shiftkey Password
The concept is that a form that has the ability to disable the Shift Key design view mode is password protected. This way only the designated users with the password can access the design view mode using the Shift Key. Create a form that can be used as a starting point that all other forms (as needed) can be accessed from.


Change the database settings so the form noted in step 1 is the startup form that is opened automatically when the database is opened.

Don't forget to remove the Tools/Menus/Navigation Options that you don't want the user to have (i.e. uncheck Display Navigation Pane & uncheck Allow Full Menus.

Template tips
Learn more about working with templates. How to change this sidebar.

Currently, you need to press the Shift Key while opening the database to access the design view mode. Create a module called ByPassShiftKey with the following code:
Option Explicit Option Compare Database Public Function SetProperties(strPropName As String , varPropType As Variant, varPropValue As Variant) As Integer[01/06/2013 01:30:42 AM]

'Dim prp As adodb. True Beep MsgBox "The Bypass Key has been enabled." 'strInput = InputBox(Prompt:=strMsg. XPos:=5000.OpenForm "frm_menu_DBA". Err.Properties.On Error GoTo Err_SetProperties Dim db As DAO.Database 'Dim db As Database. _ Title:="Form Security Check". varPropValue) db. ." & vbCrLf & vbLf & _ "The Shift key will NOT allow the users to bypass the startup options the next time the database is opened. acNormal. Create a button on the new form (frm_menu_DBA) with the On Click event as follows: Option Explicit Option Compare Database Private Sub cmd_Open_input_ByPassShiftKey_Click() On Error GoTo Err_bDisableBypassKey_Click 'This ensures the user is the programmer needing to disable the Bypass Key Dim strInput As String Dim strMsg As String Beep 'strMsg = "Do you want to enable the Bypass Key ?" & vbCrLf & vbLf & _ '"Please key the programmer's password to enable the Bypass Key.Database.Description Resume Exit_bDisableBypassKey_Click End Sub Create a button or image on the main startup form (frm_menu_Startup) with the following code for the On Click event: Option Explicit Option Compare Database Private Sub Auto_Logo0_Click() Dim sPwd As String . vbYesNo) If QI = 7 Then 'If strInput = "pk" Then SetProperties "AllowBypassKey".CreateProperty(strPropName. "Invalid Password" Exit Sub End If Exit_bDisableBypassKey_Click: Exit Sub Err_bDisableBypassKey_Click: MsgBox "bDisableBypassKey_Click". Err. Err. _ vbInformation. varPropType.". . False 'MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _' MsgBox "Bypass Key Disabled!" & vbCrLf & vbLf & _ "The Bypass Key was disabled.Description Resume Exit_SetProperties End If End Function Create a form that can be used Disable/Enable Shift Key Design View Entry.Number.Properties(strPropName) = varPropValue SetProperties = True Set db = Nothing Exit_SetProperties: Exit Function Err_SetProperties: If Err = 3270 Then 'Property not found Set prp = db. _ vbCritical.Number. YPos:=4000) Select Case sPwd Case "my!password" 'This is the password DoCmd. Err. dbBoolean.Property Set db = CurrentDb db. strMsg As String strMsg = "Please Enter Your Password" sPwd = InputBox(Prompt:=strMsg." & vbCrLf & vbLf & _ "The Shift key will allow the users to bypass the startup options the next time the database is opened. acFormReadOnly Case Else MsgBox "Sorry. Wrong Password Entered.". prp As DAO.Append prp Resume Next Else SetProperties = False MsgBox "SetProperties". Please Try Again" End Select End Sub . Title:="Disable Bypass Key Password") Dim QI As Integer QI = MsgBox("Do you want to disable the shift key?". dbBoolean.Property 'Dim db As adodb. "Set Startup Properties" Else Beep SetProperties "AllowBypassKey".

then re-open. Kallal Č ċ ShiftKeyDB. Now click the "image" & enter the password into the dialog box. SharePoint Hill Sources: Not another ms.accdb (344k) Tammy Hill. 2012. Sign in | Report Abuse | Print Page | Remove Access | Powered By Google Sites . Click the button to either Disable or Enable the Shift Key Design View Entry.access page! Albert D. Yes = Shift Key Won't Work No = Shift Key Will Work Clicking Yes will show the following image: If you open the database while holding the Shift Key. you WILL enter design mode. This will open the DBA menu. You should see the main startup form.Go ahead & close the database. Clicking No will show the following image: If you open the database while holding the Shift Key.1 ď Comments You do not have permission to add comments. you WILL NOT enter design mode. 11:45 AM v. Jun 5.