Link to home
Start Free TrialLog in
Avatar of matthewkwp
matthewkwp

asked on

Calling a module in a form.

How do you get a module to run in a form. Here is the code that I have in a module "If (KeyAscii = 13) Then SendKeys "{TAB}"".  I don't want to type it everytime and want to call it from a procedure.
ASKER CERTIFIED SOLUTION
Avatar of mcix
mcix

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mcix
mcix

You could also set KeyPreview to True on the Form and insert the following code:

Private Sub Form_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 13
            SendKeys "{Tab}"
            KeyAscii = 0
    End Select
End Sub