Can't preset or close a form because of "required" property

  • Thread starter newdatabaser via AccessMonster.com
  • Start date
N

newdatabaser via AccessMonster.com

I have a form with a number of combo boxes utilized for data entry.
I have the following properties set:
Required = yes
Default value = "NA"

I have 2 buttons on the form. They are
Reset: executes undo, writes default values, redraws form
Cancel: executes undo, closes form

Although I load default values in each box, I'd like the buttons to work
even if the user mistaken clears a box (violates required rule) and
then hits cancel or reset buttons.

Is there a way to undo the clearing of the field or a way to make
these buttons work.
 
A

Allen Browne

The command buttons are not going to work for this.

If the control is bound to a Required field, and the user deletes the entry,
Access won't let them out of that control. As a result, they can't *get* to
the button to click it: they are stuck in the control.

Simplest solution is to teach the user to press the Esc key to undo their
entry.

If that's too hard for them, they could learn to use the Undo button on the
toolbar. Since that button is not on the form, there is no problem reaching
that button.

There's an Undo on the Edit menu as well.

It is possible to trap the message in the Error event of the form if you
want to provide your own message, but that's not really a way to solve the
problem.
 

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

Top