default button on enter

  • Thread starter Thread starter bart pannemans
  • Start date Start date
B

bart pannemans

Hello,

I have a form with some unbound fields and some buttons. One of them is the
'OK'-button.

I would like that the OK-button is the default button, i.e. when people hit
enter, the code in the OKbutton_onclick -event should be executed. But as it
is now, hitting enter brings you to the next field.

Any idea how I can trap this enter-event and relay it to the onclick event,
or how I can define a defaultbutton on a form???

Thanks,

Bart
 
A button will execute by pressing Enter if it has the focus, so in the On
Current event:

Me!YourCommandButton.SetFocus

Hope that helps.
Sprinks
 
Back
Top