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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top