Home » Forms » Form Text Box Control Navigation
Form Text Box Control Navigation
Posted on June 29, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 'Forms - Form Text Box Control Navigation 'Easily navigate to next control using this code. 'Place all the text box and every control on ur form then call the module steFocusToNextControl from 'keypress event. 'key press event of the controls if keyascii = 13 then call setFocusToNextControl 'write the below code on ur form Private Sub SetFocusToNextControl() On Error GoTo ErrorHandler Select Case (ActiveControl.Name) Case "TxtFileId": TxtParticular.SetFocus Case "TxtParticular": TxtOldFileId.SetFocus Case "TxtOldFileId": TxtRackNo.SetFocus Case "TxtRackNo": TxtBeginDate.SetFocus Case "TxtBeginDate": TxtFileTyp.SetFocus Case "TxtFileTyp": TxtDescrib.SetFocus Case "TxtDescrib": Cmdadd.SetFocus End Select Exit Sub ErrorHandler: MsgBox "Control Not Exist" End Sub |
Enjoy this article?
Filed under: Forms
Leave a comment