Ctrl+F problem

D

David Mc

Currently i have a form and an event that traps Ctrl+F or
the shortcut to the find command. The problem is when ever
the F is pressed the find dalogue appears. How can i trap
the Ctrl+F together.

Thanks

My code is below:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As
Integer)

If (KeyCode = 17) And (bolCtrl = False) Then
bolCtrl = True
End If

If (bolCtrl = True) And (KeyCode = 70) Then

DoCmd.GoToControl "txtSurname"
DoCmd.DoMenuItem acFormBar, acEditMenu, 9

End If

End Sub
 
T

Tim Ferguson

If (bolCtrl = True) And (KeyCode = 70) Then

DoCmd.GoToControl "txtSurname"
DoCmd.DoMenuItem acFormBar, acEditMenu, 9

End If

I have no idea what bolCtrl means, but the normal way to do this would be

If (Shift And acCtrlMask) and (KeyCode = 70) Then



and don't forget to set KeyCode to zero when exiting the procedure, to
prevent the default seach box appearing anyway.

Hope that helps



Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top