Link to home
Start Free TrialLog in
Avatar of kevbb
kevbb

asked on

Run A sub procedure from within a sub procedure - MS ACCESS

Hi Experts...Im using MS access. Im trying to get a sub procedure to run if the enter key is pressed while the form is open. I have the below code to try and capture when the Enter key is pressed. It then is supposed to run the mousedown event of a label
(which Im using instead of a button). The label is called "LblLogin", so the mousedown event will run if the label is clicked on, or if the enter key is pressed....any help would be greatly appreciated.

Kevbb.

Private Sub Form_KeyPress(KeyASCII As Integer)
If KeyASCII = 13 Then
KeyASCII = 0
LblLogin_MouseDown
Else
End If
End Sub
ASKER CERTIFIED SOLUTION
Avatar of basicinstinct
basicinstinct
Flag of Australia image

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 kevbb
kevbb

ASKER

Cool thanks...that did the trick. Sometimes you cant see your nose despite your face.
Thankyou for your help, you save me alot of stress.

Rgds / Kevbb.