473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Shift Bypass Enable/Disable Password Protection

I have a code for enabling a command button to password protect the enabling/disabling of the Shift bypass. For some reason though I keep recieving a syntax error when I try to use it. I copied the code from the following link: http://www.databasedev.co.uk/disable_shift_bypass.html It seems to have a problem with the part that reads:
MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
"The Shift key will allow the users to bypass the startup & _
options the next time the database is opened.", _
vbInformation, "Set Startup Properties"
I did not really understand the first part of the directions about setting my references, so I don't know if that is the reason it is failing?

Any comments would be greatly appreciated.

Thanks.

Here is my full code behind the command button:

Expand|Select|Wrap|Line Numbers
  1.  
  2. On Error GoTo Err_bDisableBypassKey_Click
  3. 'This ensures the user is the programmer needing to disable the Bypass Key
  4. Dim strInput As String
  5. Dim strMsg As String
  6. Beep
  7. strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
  8. "Please key the programmer's password to enable the Bypass Key."
  9. strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
  10. If strInput = "burlington" Then
  11. SetProperties "AllowBypassKey", dbBoolean, True
  12. Beep
  13. MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
  14. "The Shift key will allow the users to bypass the startup & _
  15. options the next time the database is opened.", _
  16. vbInformation, "Set Startup Properties"
  17. Else
  18. Beep
  19. SetProperties "AllowBypassKey", dbBoolean, False
  20. MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
  21. "The Bypass Key was disabled." & vbCrLf & vbLf & _
  22. "The Shift key will NOT allow the users to bypass the & _
  23. startup options the next time the database is opened.", _
  24. vbCritical, "Invalid Password"
  25. Exit Sub
  26. End If
  27. Exit_bDisableBypassKey_Click:
  28. Exit Sub
  29. Err_bDisableBypassKey_Click:
  30. MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
  31. Resume Exit_bDisableBypassKey_Click
  32.  
  33. End Sub
  34.  
Jun 14 '07 #1
3 11701
MMcCarthy
14,534 Expert Mod 8TB
You were having problems with your message boxes. They should work find with the following ammendments ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. On Error GoTo Err_bDisableBypassKey_Click
  3. 'This ensures the user is the programmer needing to disable the Bypass Key
  4. Dim strInput As String
  5. Dim strMsg As String
  6.     Beep
  7.     strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
  8.     "Please key the programmer's password to enable the Bypass Key."
  9.     strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
  10.     If strInput = "burlington" Then
  11.         SetProperties "AllowBypassKey", dbBoolean, True
  12.         Beep
  13.         MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
  14.         "The Shift key will allow the users to bypass the startup " & _
  15.         "options the next time the database is opened.", vbInformation, "Set Startup Properties"
  16.     Else
  17.         Beep
  18.         SetProperties "AllowBypassKey", dbBoolean, False
  19.         MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
  20.         "The Bypass Key was disabled." & vbCrLf & vbLf & _
  21.         "The Shift key will NOT allow the users to bypass the " & _
  22.         "startup options the next time the database is opened.", _
  23.         vbCritical, "Invalid Password"
  24.         Exit Sub
  25.     End If
  26. Exit_bDisableBypassKey_Click:
  27.     Exit Sub
  28. Err_bDisableBypassKey_Click:
  29.     MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
  30.     Resume Exit_bDisableBypassKey_Click
  31. End Sub
  32.  
Jun 14 '07 #2
Works like a charm!

Thank you so much Mary for your continued expertise!


You were having problems with your message boxes. They should work find with the following ammendments ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. On Error GoTo Err_bDisableBypassKey_Click
  3. 'This ensures the user is the programmer needing to disable the Bypass Key
  4. Dim strInput As String
  5. Dim strMsg As String
  6.     Beep
  7.     strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
  8.     "Please key the programmer's password to enable the Bypass Key."
  9.     strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
  10.     If strInput = "burlington" Then
  11.         SetProperties "AllowBypassKey", dbBoolean, True
  12.         Beep
  13.         MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
  14.         "The Shift key will allow the users to bypass the startup " & _
  15.         "options the next time the database is opened.", vbInformation, "Set Startup Properties"
  16.     Else
  17.         Beep
  18.         SetProperties "AllowBypassKey", dbBoolean, False
  19.         MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
  20.         "The Bypass Key was disabled." & vbCrLf & vbLf & _
  21.         "The Shift key will NOT allow the users to bypass the " & _
  22.         "startup options the next time the database is opened.", _
  23.         vbCritical, "Invalid Password"
  24.         Exit Sub
  25.     End If
  26. Exit_bDisableBypassKey_Click:
  27.     Exit Sub
  28. Err_bDisableBypassKey_Click:
  29.     MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
  30.     Resume Exit_bDisableBypassKey_Click
  31. End Sub
  32.  
Jun 22 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Works like a charm!

Thank you so much Mary for your continued expertise!
You're welcome.
Jun 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make...
1
by: Ghulam | last post by:
I am using an Access 2k ADP (Converted into ADE) front end and SQL 2K on the backend. Although I taught pretty much myself into these concept with the help of some publications and users group...
7
by: Susan Bricker | last post by:
I know that I saw some information concerning the <shift>+<enter> combination use to bypass launching an Access mdb application and enter the Access design workspace. Would someone please direct...
4
by: Paul T. RONG | last post by:
Dear All, I add two new tables to the database and then the disable shift key codes don't work. These two new tables are actually created by two queries, and only these two are in the front end,...
3
by: tdmailbox | last post by:
I set up my code to disable the shift bypass however for certain users I want to allow them through a button no a form to be able open up the list of tablies and queries. Is there a vb command...
1
by: simonmarkjones | last post by:
Hi i'm trying to disable the shift key from allowing users to access the design view. I've done a search in groups and know i need to somehow do AllowBypassKey. Everywhere i look there is code...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
1
by: OlaPihl | last post by:
Hi, How can I by code enable and disable "Bypass proxy server for local adresses" in Internet Explorer / Tools / Internet Options / Connections / LAN Settings. I have made a program (VB.Net)...
3
by: jamesnkk | last post by:
Hi, I need an advise from the experts here - I have configure the Tools - Startup option to run the application. But if User hold down the SHIFT key it can bypass the startup options to access...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.