disable f11 key

F

frank

How do I disable the F11 key from bring up the database
window? What would some of the vb code look like?
 
J

Joshua A. Booker

Frank,

Tools | Startup
UnCheck 'Use Special Keys' and 'Display Database Window' Options

HTH,
Josh
 
G

George Nicholson

Using VBA:

SetDAOObjectProperty CurrentDb, "StartupShowDBWindow", dbBoolean, False

Public Function SetDAOObjectProperty(objDAOObject As Variant, strPropName As
String, varPropType As Variant, varPropValue As Variant) As Integer
' Set properties of a DAO object (i.e., database, table, field).
' If property doesn't exist, it will be created.

Dim prp As DAO.Property
Const conPropNotFoundError As Integer = 3270

On Error GoTo ErrHandler
' Compare and change only if different
If objDAOObject.Properties(strPropName) <> varPropValue Then
objDAOObject.Properties(strPropName) = varPropValue
End If
SetDAOObjectProperty = True
ExitHere:
Set objDAOObject = Nothing
Set prp = Nothing
Exit Function
ErrHandler:
If err = conPropNotFoundError Then ' Property not found.
Set prp = objDAOObject.CreateProperty(strPropName, varPropType,
varPropValue)
objDAOObject.Properties.Append prp
Resume Next
Else
' Unknown error.
' Call ErrorLog(mDocName, "SetDAOObjectProperty") <code not included
here >
SetDAOObjectProperty = False
Resume ExitHere
End If
End Function

This is from a current project and appears to be self contained. It is a
safe bet that this is a modified variation of code found in some version of
the Access Developers Handbook (Sybex, by Ken Getz, et al). Therefore,
credit them if it works for you, blame me if it doesn't.

Hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to Disable Shift and F11 Keys 8
Disable F11 Key 12
code do desactivate F11 2
Blocking User Access To App 3
Disable F11 Key 1
Disable access to the database window 8
Disable F11 key in VBA 1
Compile Errors 2

Top