By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

Function Key is not being trapped!

P: 4
Access 2013, Key Preview = Yes, No AutoKeys, attached code below.

Private Sub LastName_KeyDown(KeyCode As Integer, Shift As Integer)
'Allows use of Function Keys on the form
On Error GoTo Error_Handler
Select Case KeyCode

Case vbKeyF5
'Sets you up to search for a person by LAST NAME
MsgBox ("F5")
DoCmd.OpenForm "Find_Customer_Last_Start_Form", acNormal, , , , acWindowNormal
'Right, Down, Width, Height
DoCmd.MoveSize 6300, 6200, 5800, 3650
DoCmd.GoToControl "txtBxFind_Last_Name"
KeyCode = 0
End Select
Exit Sub

MsgBox "Error"
End Sub

Question is this: pressing the F5 key still gives me the Open database form for access. It has to be something i am doing wrong of course. Any suggestions. Greatly appreciated.

Secondary Note: I set the option below with NO CHECK and still the same thing.

File -> Option -> Current DB -> Use Access special Keys (Uncheck)
Jul 18 '17 #1
Share this Question
Share on Google+
1 Reply

P: 4
This reply is from Odie1952. Answering my own question. Sorry this took so long to figure out why my Function keys would not work in this access database. But here is the short of it. "BAD KEYBOARD" - yes that is correct. I searched web all over and couldn't find the answer to why the (F) keys would not work. Even went so far as to isolate the problem into a simple database and did some testing with an outside program .... yep there it was, intermittent keybindings from a Microsoft 2000 ergonomic keyboard. So, I unplugged the keyboard and plugged in a $10 keyboard and waaaaa laaaaaa.... worked fine. Sorry. This only proves 1 thing, never ever give up .. there is got to be a reason it doesn't work.
Jul 22 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.