Hello,
I have a subform called subStoreOrder and a main form called StoreOrder. In the sub form I have the following code that runs on the On Key Press Event.
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 17 Then
Forms![StoreOrder].SetFocus
currentstore = cmbStore.Value
cmbStore.Value = currentstore + 1
Else
End If
End Sub
What I am trying to do is when Ctrl + q is pressed it runs the code. The code is suppose to first set the focus to the main form (Store Order), then work out the value of cmbStore (cmbStore is a combo box on the main form. It contains a numeric ID for each store) and then go to the next ID in cmbStore. However I get the following error.
Runtime error '424'
Object Required.
Can anybody please help?
I have a subform called subStoreOrder and a main form called StoreOrder. In the sub form I have the following code that runs on the On Key Press Event.
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 17 Then
Forms![StoreOrder].SetFocus
currentstore = cmbStore.Value
cmbStore.Value = currentstore + 1
Else
End If
End Sub
What I am trying to do is when Ctrl + q is pressed it runs the code. The code is suppose to first set the focus to the main form (Store Order), then work out the value of cmbStore (cmbStore is a combo box on the main form. It contains a numeric ID for each store) and then go to the next ID in cmbStore. However I get the following error.
Runtime error '424'
Object Required.
Can anybody please help?