G
Guest
I have the following code on two forms. On one of the forms it works
correctly. on the other form when I press the enter key it skips a record.
Does anyone know why and how to correct the problem. Thanks in advance.
Private Sub Form_KeyPress(KeyAscii As Integer)
On Error GoTo Err_Form_KeyPress
If KeyAscii = 13 Then
KeyCode = 0
DoCmd.GoToRecord , , acNext
'set focus on QTY_PD_TO_DT field
Me.QTY_PD_TO_DT.SetFocus
End If
Exit_Form_KeyPress:
Exit Sub
Err_Form_KeyPress:
MsgBox Err.Description
Resume Exit_Form_KeyPress
End Sub
correctly. on the other form when I press the enter key it skips a record.
Does anyone know why and how to correct the problem. Thanks in advance.
Private Sub Form_KeyPress(KeyAscii As Integer)
On Error GoTo Err_Form_KeyPress
If KeyAscii = 13 Then
KeyCode = 0
DoCmd.GoToRecord , , acNext
'set focus on QTY_PD_TO_DT field
Me.QTY_PD_TO_DT.SetFocus
End If
Exit_Form_KeyPress:
Exit Sub
Err_Form_KeyPress:
MsgBox Err.Description
Resume Exit_Form_KeyPress
End Sub