I know I can uncheck all the unecessary views from startup dialogue. I heard of the user can bypass that using 'shift', how to disable the bypass in VBA? Thanks
I know this is very interesting, but I wasn't able to turn the bypasskey off, I tried the example in the access help, I have no luck with that, does anyone did that before? Thanks
The code under works:
Call this from the immediate screen of during startup and you will be locked out of your project for good (so do it only on a copy) ;-).
[tt]
Private Const ErrPropNotFound As Long = 2455
Public Sub SetAllowByPassKey(Enable As Boolean)
On Error Resume Next
Dim blnReturn As Boolean
blnReturn = True
CurrentProject.Properties("AllowBypassKey"). _
Value = Enable
If Err.Number = ErrPropNotFound Then
CurrentProject.Properties.Add _
"AllowBypassKey", Enable
Else
blnReturn = False
End If
Err.Clear
End Sub
Yeah, ALWAYS give yourself a back door into your database--a way to re-enable the shift key bypass. Here's a quote of mine from another thread on this topic:
The way I do it is that there's a button only visible to people in the admins group. Clicking on that re-enable's the shift key, so the next time you open the database the shift key will be enabled. Another button (or the same one, or a toggle, or whatever) re-disables it. Hopefully you've got a copy of the database that hasn't yet run this code!!
---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.