Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you define a different F11 key?

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
Is it possible to setup a key other than F11 to display a hidden database window?

Thanks.

--
Mike

In defeat: unbeatable. In victory: unbearable. -- Winston Churchill
 
hi Mike.

there may be a way to change a setting in the Access Application itself, but i'm not aware of it.

i have an idea for something you can try, but it's very limited.

as a test, try this.

Step 1 -

enter the following line of code in the Form Load property of your main form.

Me.KeyPreview = True

Step 2 -

In the Key Down property of the form enter the following.

Select Case KeyCode
Case vbKeyF2
' Process F2 key events.
SendKeys "{F11}", False
Case vbKeyF3
' Process F3 key events.
Case vbKeyF4
' Process F4 key events.
Case Else
End Select

Step 3 -

Before you test, make sure in the Startup you specify that the Display Database Window checkbox is unchecked.

Step 4-

Now, open the main form. When you key F2 does it open the database window?

as you can see, i have set it so that when F2 is keyed, SendKeys tells the program to key F11 which will open the database window.

you may need to include this in each form/report, or you may be able to include the code in a module and call it each time it is needed.

i know this is very sketchy. i've never really tried to do this before.

i hope this leads you in the right direction.
 
cghoga,

Thanks for the info. I'll give it a try this week and let you know how it goes. Thanks again.

--
Mike

In defeat: unbeatable. In victory: unbearable. -- Winston Churchill
 
Here's another way. Say you want to use Ctrl-F2 to show the database window.

1. Create a new macro (group).
2. Click the toolbar Macro Names button (or use the menu) to display the Macro Name column.
3. Enter a macro named [red]^{F2}[/red] and set its Action to Select Object.
4. In the Object Type and Object Name parameters, select anything you want.
5. Set the In Database Window parameter to Yes.
6. Save the macro group with the name AutoKeys.

From then on, pressing Ctrl-F2 will run the SelectObject action, and since you said to select the object in the Database Window, the window will be unhidden.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Mike555,

I have disabled the F11 key and have a invisible button on a form. You can click to bring the database window up, code below,

Private Sub Label7_Click()
DoCmd.SelectObject acForm, "CurrentForm", True
DoCmd.CLOSE


Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top