disable f11 key

  • Thread starter Thread starter frank
  • Start date Start date
F

frank

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

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

HTH,
Josh
 
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,
 
Back
Top