Associte Ok button with Enter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have made a report that takes its parameters from a form. What code should
I write for the OK button so that when a person presses enter on the
keyboard, it will have same effect as pressing OK button on the form. Thanks.
Purnima Sharma
 
If that is what you want, then set the Default property of the button to
True (Yes).

From on line help on the Default property.
When the command button's Default property setting is Yes and the Form
window is active, the user can choose the command button by pressing ENTER
(if no other command button has the focus) as well as by clicking the
command button.

Only one command button on a form can be the default button. When the
Default property is set to Yes for one command button, it is automatically
set to No for all other command buttons on the form.

Tip For a form that supports irreversible operations, such as deletions,
it's a good idea to make the Cancel button the default command button. To do
this, set both the Default property and the Cancel property to Yes.
 

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