From: iccsi on
Is it possible to run code when user click on some control key like
ctrl- F?

Your information is great appreciated,

From: Daryl S on
iccsi -

Look up KeyPreview, which will let you trap keystrokes on a form.

--
Daryl S


"iccsi" wrote:

> Is it possible to run code when user click on some control key like
> ctrl- F?
>
> Your information is great appreciated,
>
> .
>
From: iccsi on
On May 10, 2:45 pm, Daryl S <Dar...(a)discussions.microsoft.com> wrote:
> iccsi -
>
> Look up KeyPreview, which will let you trap keystrokes on a form.
>
> --
> Daryl S
>
>
>
> "iccsi" wrote:
> > Is it possible to run code when user click on some control key like
> > ctrl- F?
>
> > Your information is great appreciated,
>
> > .- Hide quoted text -
>
> - Show quoted text -

Thanks for the message,
I get trap keystorke vbKeyControl or vbKeyF, but can not trap both of
them at same time.
Thanks again,

From: Douglas J. Steele on
If you're trying in the KeyDown event, use

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyF) And (Shift And acCtrlMask) > 0 Then
MsgBox "Ctrl-F", , "Form_KeyDown"
End If
End Sub

If you're trying in the KeyPress event, use

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 102 Then
MsgBox "Ctrl-F", , "Form_KeyPress"
End If
End Sub


--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"iccsi" <inungh(a)gmail.com> wrote in message
news:788823f9-c37e-4b1a-b87f-6828520b3473(a)37g2000yqm.googlegroups.com...
On May 10, 2:45 pm, Daryl S <Dar...(a)discussions.microsoft.com> wrote:
> "iccsi" wrote:
> > Is it possible to run code when user click on some control key like
> > ctrl- F?
>
> > Your information is great appreciated,
>
> > .- Hide quoted text -
>
> - Show quoted text -

Thanks for the message,
I get trap keystorke vbKeyControl or vbKeyF, but can not trap both of
them at same time.
Thanks again,


From: Stuart McCall on
"iccsi" <inungh(a)gmail.com> wrote in message
news:788823f9-c37e-4b1a-b87f-6828520b3473(a)37g2000yqm.googlegroups.com...
On May 10, 2:45 pm, Daryl S <Dar...(a)discussions.microsoft.com> wrote:
> iccsi -
>
> Look up KeyPreview, which will let you trap keystrokes on a form.
>
> --
> Daryl S
>
>
>
> "iccsi" wrote:
> > Is it possible to run code when user click on some control key like
> > ctrl- F?
>
> > Your information is great appreciated,
>
> > .- Hide quoted text -
>
> - Show quoted text -

Thanks for the message,
I get trap keystorke vbKeyControl or vbKeyF, but can not trap both of
them at same time.
Thanks again,

In your form's KeyDown event procedure:

If KeyCode = vbKeyF Then
If (Shift And vbCtrlMask) = vbCtrlMask Then
KeyCode = 0
MsgBox "Ctrl-F was pressed"
End If
End If


 |  Next  |  Last
Pages: 1 2
Prev: Ctrl- F for search
Next: Export query to XML file