Hi all,
I have two textboxes only in a form. At textbox1, upon pressing enter/carriage return it suppose to setfocus to textbox2 instead it's performing textbox2's keypress event by calling a command button. How to handle this? Where am i doing wrong? Please help.
Private Sub txtSNO_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'if ENTER or carriage return then move to next text box
txtRMANo.SetFocus
End If
End Sub
Private Sub txtRMANo_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Chr(13) Then 'if ENTER or carriage return then call print command button
Call cmdPrint_Click
End If
End Sub