Disable F11 in Access 2007

Is there a way to disable F11 from working in Access 2007?

Thanks, pat
PatKungAsked:
Who is Participating?
 
PatKungAuthor 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

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

Thanks, Pat
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
jppintoCommented:
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
0
 
PatKungAuthor 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

0
 
PatKungAuthor 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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.