Good afternoon. I have a OnKeyDown event procedure, which when CTRL-b is pressed It increase the value of PartGroup by one. It is not increasing it at all. Can someone please look at this code and tell me what I did wrong?
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim ControlDDown As Integer
ControlDDown = (KeyCode = vbKeyD And Shift And acCtrlMask) > 0
If ControlDDown = True Then
Me!PartGroup = Me!PartGroup + 1
Me!ItemNumber = Nz(DMax("[ItemNumber]", "stblECN_BOM", "[PartGroup] = " & Me!PartGroup), 0) + 1
End If
End Sub
I haven't gotten far enoughto know if it is resetting ItemNumber to to 1 yet. Thank you very much to anyone who helps straighten this out
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim ControlDDown As Integer
ControlDDown = (KeyCode = vbKeyD And Shift And acCtrlMask) > 0
If ControlDDown = True Then
Me!PartGroup = Me!PartGroup + 1
Me!ItemNumber = Nz(DMax("[ItemNumber]", "stblECN_BOM", "[PartGroup] = " & Me!PartGroup), 0) + 1
End If
End Sub
I haven't gotten far enoughto know if it is resetting ItemNumber to to 1 yet. Thank you very much to anyone who helps straighten this out