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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOTKEY NEEDED TO OPEN FORMS

Status
Not open for further replies.

fsweb2002

Programmer
Apr 11, 2002
94
TR
Hi there

I have 5 different forms that I jump from one to another all the time.

I would like to add Hotkeys (alt+number) so the form required opens with the same hotkey regardless in which form you are at the time.

Any ideas ?
 
look up 'access keys' in help menu, this may help. If not you could put 4 buttons at top of each form so when clicked they each open 1 of the other forms!
 
Have you tried changing the captions of each command button to include the ampersand?

e.g. "&1. Form1name"
"&2. Form2name"

This would allow you to use the alt+number keys to run the code for that button.
 
thanks to all for your reply

I am looking for an easier answer...
A global hotkey that will work whetever it you are at the time.

I know I can put the buttons of all the forms on EACH form, however I am trying to avoid doing that (if there is another way!)

thanks anyway
 
If you have the following public sub in a module, obviously you can add whatever key combos you want.

Public Sub mOpenForm(ByRef vintKey As Integer, ByVal vintShift As Integer)
If vintKey = vbKeyF3 And (vintShift And acAltMask) > 0 Then
'open form on alt - F3
End If

If vintKey = Asc("A") And (vintShift And acAltMask) > 0 Then
'open form on alt - A
End If

If vintKey = Asc("1") And (vintShift And acAltMask) > 0 Then
'open form on alt - 1
End If
End Sub


on each form set the key preview to true.

and in the Form_KeyDown for each form put the following

mOpenForm KeyCode, Shift

Hope this is a help
 
You could try using the AUTOKEYS macro (see HELP Autokeys)
This allows you to set up hot keys.
The AUTOKEYS macro runs automatically when the database is opened.
 
GHolden

That´s exactly what I was looking for !!!

You are a legend "!!!!!

Thanks everyone else for helping too

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top