Binding a key to a form control

flect

Registered User.
Local time
Tomorrow, 01:56
Joined
Feb 26, 2008
Messages
86
Hey everyone!

Hopefully this a simple problem

I have a working form with a few subforms that I navigate through.

I have my stock record on the main form and quantity details on the subform

Basically I want to hard code the + / - keys on the Numpad to go forward/back a record regardless what subform I'm on.

at the moment i've tried a Select Case Keycode setup but the problem is that it's locked to my main form. when i go to subform or the splitview table the buttons don't work.

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

Select Case KeyCode
  Case vbKeySubtract
  DoCmd.RunCommand acCmdRecordsGoToPrevious
  Case vbKeyAdd
  DoCmd.RunCommand acCmdRecordsGoToNext
  End Select
End Sub

I realise it's a Form_KeyDown - but i assumed that would filter through to the subforms, but that doesn't appear to be the case.

Any ideas? :)
 
Thanks Bob!

I've had a look at the VB behind the DB, but the DB itself doesn't work, it says "the project contains a missing or broken reference to the file 'utility.mda'" - no biggie, the VB should give me plenty of ideas
 

Users who are viewing this thread

Back
Top Bottom