ahmedjamalaboelez
Ahmed J. Aboelez
- Local time
- Yesterday, 18:36
- Joined
- Feb 25, 2015
- Messages
- 79
Hello
i have database with buttons ( new -Save - Cancel -Delete - Exit) in each form i use keys (F1-F2-F3-F4-F5) on form key down event to run my code ,
F keys run good when not focused in form objects or sub form objects code as follow
Problem : when i'm set focused in a textbox in subform code not run , how could i set up code as public sub to set ( keyDown Event for each object included in this form , so i can call while form load or opening
thanks
i have database with buttons ( new -Save - Cancel -Delete - Exit) in each form i use keys (F1-F2-F3-F4-F5) on form key down event to run my code ,
F keys run good when not focused in form objects or sub form objects code as follow
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF1
KeyCode = 0
MsgBox "F1 Pressed"
Case vbKeyF2
KeyCode = 0
MsgBox "F2 Pressed"
Case vbKeyF3
KeyCode = 0
MsgBox "F3 Pressed"
Case vbKeyF4
KeyCode = 0
MsgBox "F4 Pressed"
Case vbKeyF5
KeyCode = 0
MsgBox "F5 Pressed"
End Select
End Sub
Problem : when i'm set focused in a textbox in subform code not run , how could i set up code as public sub to set ( keyDown Event for each object included in this form , so i can call while form load or opening
thanks