• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 915
  • Last Modified:

Trying to enable F11 in Access 2007 database

How do I enable f11 on an access 2007 database.  I've already enabled the Use Access Special Keys option
0
chtullu135
Asked:
chtullu135
1 Solution
 
Dale FyeCommented:
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.
0
 
chtullu135Author Commented:
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
0
 
Dale FyeCommented:
Sorry.  I thought you wanted to assign some functionality to the F11 key from within an application you were developing.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
chtullu135Author Commented:
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.
0
 
chtullu135Author Commented:
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
0
 
Jeffrey CoachmanCommented:
Turn on the Access Option:  "Use Special Keys"
untitled.JPG
0
 
chtullu135Author Commented:
boag2000
I've already done that with the results as described in my latest post
0
 
ComputerAidNZCommented:
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_DisableSpecialKeys:
    Exit Function

Err_DisableSpecialKeys:
    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
    Else
        MsgBox "Disable did not Work!!"
        DisableSpecialKeys = True
        Resume Exit_DisableSpecialKeys
    End If
End Function
++++++++++
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now