We help IT Professionals succeed at work.

Disable F11 in Access 2007

PatKung
PatKung asked
on
Medium Priority
1,228 Views
Last Modified: 2012-05-06
Is there a way to disable F11 from working in Access 2007?

Thanks, pat
Comment
Watch Question

Author

Commented:
Both of those posts are prior to Access 2007.  Will they work in 2007 version of Access?

Thanks, Pat

Commented:
I believe that they work in Access 2007. I'm not able to test it now because here I don't have Access 2007, only at home. Why don't you try it?

jppinto

Author

Commented:
In the first one he never explains were to put this code in the program.  The rest I understand sort of.
Not sure exactly where in the shortcut to put the two lines he mentions.  There is a Target field and a Start In field.  Which field should the lines below go into?  Thanks, Pat

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Joni_Myer\Databases\Joni_Myer_051201.mdb"/cmd"PutYourPasswordHere"


MsgBox "The application is now unlocked@" & _
       "The application quit now. You will now be able to open the database while holding down the 
 
shift key.@" & _
       "To lock the application again open the database without the special command line parameter 
 
found in this shortcut.", _
       vbOKOnly, "WARNING"

Open in new window

Author

Commented:
OK, ignore my last comment.  Figured out how to create a shortcut in Vista but it still doesn't work with the command line it wanted me to put in.

Any suggestions?
Thanks, Pat
Commented:
Couldn't get any of these to work - probably lack of knowledge on my part.  Attached the code I did use.  
Thanks to all who tried to help.
Pat Kung
'***Not sure where I found this or I would give credit where it is due.
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 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
 
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 Database
Dim prop As 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

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.