Trying to enable F11 in Access 2007 database

Posted on 2011-05-05
Last Modified: 2012-06-27
How do I enable f11 on an access 2007 database.  I've already enabled the Use Access Special Keys option
Question by:chtullu135
    LVL 47

    Expert Comment

    by:Dale Fye (Access MVP)
    If you are talking about using it withing an application, then you need to set the forms KeyPreview property to Yes.

    Then, use either the KeyUp or KeyDown event of the form to test to determine whether the key pressed was F11, and then initiate some action.

    Author Comment

    I'm not sure I understand.  I want to be able to press f11 to get to the database window  when the application is open
    LVL 47

    Expert Comment

    by:Dale Fye (Access MVP)
    Sorry.  I thought you wanted to assign some functionality to the F11 key from within an application you were developing.

    Author Comment

    Basically, this is an inherited application that I'm maintaining.  I made a copy of it to work on.  However, I'm finding that F11 works on the original database but not on the copy.

    Author Comment

    I noticed that when I unchecked the Use Access Special Keys option, then rechecked it, I was able to bring the database window showing the database objects to the foreground.  However, when I closed the application and reopened it, F11 would not work
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    Turn on the Access Option:  "Use Special Keys"

    Author Comment

    I've already done that with the results as described in my latest post
    LVL 2

    Accepted Solution

    It sounds like it is done programmatically, so I suggest you run the code to turn it back on again somewhere maybe in the opening form or somewhere after the programme turns it off.  Since you probably don't know where it is, then running the codewhen you open a form is probably not a bad idea - for now anyway.

    I found this code and edited it to suit, so creat this function and run it where appropriate. I diod not test the function (a bit rushed), but it looks OK
    Public Function DisableSpecialKeys() As Boolean
    On Error GoTo Err_DisableSpecialKeys

    Dim db As Database
    Dim Prop As Property
    Const conPropNotFound = 3270
    Set db = CurrentDb()db.Properties("AllowSpecialKeys") = True
    Set db = Nothing
    DisableSpecialKeys = False

        Exit Function

        If Err = conPropNotFound Then
            'If the property doesn't exist, create it
            Set Prop = db.CreateProperty("AllowSpecialKeys", dbBoolean, True)
            db.Properties.Append Prop
            Resume Next
            MsgBox "Disable did not Work!!"
            DisableSpecialKeys = True
            Resume Exit_DisableSpecialKeys
        End If
    End Function

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now