Most MsDos programs used the Enter key to move from one field to the next one. You can easily simulate this behavior by setting the form’s KeyPreview property to True and writing this code in the Form_KeyPress event:
Sub Form_KeyPress (KeyAscii As Integer) If KeyAscii = 13 Then If TypeOf ActiveControl Is TextBox Then SendKeys "{TAB}" KeyAscii = 0 End If End IfEnd Sub
This technique works only if there is no command button on the form with its Default property set to True, because in that case the Form_KeyPress would not trap the Enter key.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.






















