|
-
Sep 8th, 2012, 11:44 AM
#1
Thread Starter
Fanatic Member
Search Option
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
-
Sep 8th, 2012, 10:51 PM
#2
Re: Search Option
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.
-
Sep 9th, 2012, 12:41 AM
#3
Re: Search Option
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.
-
Sep 9th, 2012, 12:51 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|