I've got a big form with two smaller forms. The main form takes the left 1/3 of the screen, subform1 the upper right, and subform2 the lower right portion of the screen. I want the user to be able to advance to subform1 with a control/M and to subform2 with a control/B keystroke.
I used this code:
Expand|Select|Wrap|Line Numbers
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- ' control/M will set the focus to the packages
- If KeyCode = vbKeyM And vbKeyControl Then
- 'Forms!frm_OEShippingSelectCustomer!fsub_OEShippingProduct.
- With Forms!frm_OEShippingSelectCustomer!fsub_OEShippingProduct
- !txtQtyShipped.SetFocus
- !txtQtyShipped = 99 ' just to see if anything happened
- End With
- KeyCode = 0
- End If
- ' CONTROL/B will load the form for boxes/packages
- If KeyCode = vbKeyB And vbKeyControl Then
- Forms!frm_OEShippingSelectCustomer!fsub_OEShippingProduct.Form!!txtWeight.SetFocus
- KeyCode = 0
- End If
- End Sub
How do I get parked on the proper form after my control keystroke?
Thanks,
Jim