Ctrl+F problem

  • Thread starter Thread starter David Mc
  • Start date Start date
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
 
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
 
Back
Top