Calling cmdEnter_Click()

  • Thread starter Thread starter Marcel K.
  • Start date Start date
M

Marcel K.

When user hits enter button after adding password in text
control for password, the focus goes to the OK (enter
Button). The effect I am trying for here is like logging
onto windows OS, hit the enter button once to logon. All
the validation code is in the click event of the cmdEnter
button. Below - when the button gets focus from hitting
enter key, I want to call the click event to fire up
validation code....does not appear to be working, though

Private Sub cmdEnter_GotFocus()
cmdEnter_Click
End Sub

Regards, Marcel K.
 
When user hits enter button after adding password in text
control for password, the focus goes to the OK (enter
Button). The effect I am trying for here is like logging
onto windows OS, hit the enter button once to logon. All
the validation code is in the click event of the cmdEnter
button. Below - when the button gets focus from hitting
enter key, I want to call the click event to fire up
validation code....does not appear to be working, though

Private Sub cmdEnter_GotFocus()
cmdEnter_Click
End Sub

Instead of using the "GotFocus" event procedure, just set the command button's
"Default" property to "Yes". You'll find it on the property sheet's "Other" tab.
 
Bruce - thanks for the tip, it did the trick..
-----Original Message-----

Instead of using the "GotFocus" event procedure, just set the command button's
"Default" property to "Yes". You'll find it on the property sheet's "Other" tab.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)
within the newsgroups so that all might benefit.<<


.
 
Back
Top