?
Solved

Disable F11 in Access 2007

Posted on 2009-02-13
6
Medium Priority
?
1,199 Views
Last Modified: 2012-05-06
Is there a way to disable F11 from working in Access 2007?

Thanks, pat
0
Comment
Question by:PatKung
  • 4
  • 2
6 Comments
 

Author Comment

by:PatKung
ID: 23637908
Both of those posts are prior to Access 2007.  Will they work in 2007 version of Access?

Thanks, Pat
0
 
LVL 33

Expert Comment

by:jppinto
ID: 23637922
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:PatKung
ID: 23638197
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
 

Author Comment

by:PatKung
ID: 23638987
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
 

Accepted Solution

by:
PatKung earned 0 total points
ID: 23701953
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question