Hi
I want when user Press Ctrl+F or F5 button inputbox should open and user enters something for search . Search can be a part of string
Thanks
Hi
I want when user Press Ctrl+F or F5 button inputbox should open and user enters something for search . Search can be a part of string
Thanks
for F5 (from Form1)
Code:Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim BoxResult As String If KeyCode = vbKeyF5 Then BoxResult = InputBox("Search For", "Search Input Box") End If Debug.Print "Searching for " & Chr(34) & BoxResult & Chr(34) End Sub
Last edited by Max187Boucher; Sep 9th, 2012 at 12:50 AM.
Not sure why you would set key preview in the keydown event. That really should be in the form load event or selected in the properties window. In the key down event if there is a control on the form that gets focus it will never be executed and if not then it is not needed plus would execute with every keystroke where it only needs to execute once.
I would suggest removing that from the event.
Yes boss