shortcut keys

ahvc

Registered User.
Local time
Today, 21:07
Joined
Jun 17, 2002
Messages
41
Hello All

I would like to keep some shortcuts in my application for the user. But I have not been able to suceed yet. Can you please help?

The form I am using this has 5 pages in one tap controrl. I would like to assign one shortcut key for each page in the tab controrl. I wrote this code , to capture 'ctrl+z'; and I wanted the controrl to go to the second page in the tab controrl.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim intctrl As Integer
intctrl = (Shift And acCtrlMask) > 0
If intctrl And KeyCode = vbKeyZ Then
KeyCode = 0
Me!TabCtl0.Pages(2).SetFocus
End If

But this is not working. Can anyone pl suggest what I need to fix here.

thanks
VC
 
It's possible that you could use a macro, and point a button to it.
Haven't done it myself, but I think it might work.
 
i see no problem with your code, however, you may have forgotten to set the Key Preview property of the Form to YES.

Key Preview = Yes
 
joeyreyma
It worked like a charm.. thanks very much for the hint..

Stafford. Thank you for the idea.. I did not have enough time to figure to do with a macro.. I am sure it must be possible some way..

Thanks again.
VC
 

Users who are viewing this thread

Back
Top Bottom