Want Users to Push Save Button when entering New Data

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

Guest

I have never figured this out, but I don't like having users advancing from
completed record to empty form when entering data. I want them to use the
Save button to force new record entry. But I just get to the last field and
when I Tab or hit Enter, it goes to a new record. How can I stop that
behavior and force a Save command button to do that task?

Amazingly, I have spent years not knowing how to do this.
 
Lambi000 said:
I have never figured this out, but I don't like having users
advancing from completed record to empty form when entering data. I
want them to use the Save button to force new record entry. But I
just get to the last field and when I Tab or hit Enter, it goes to a
new record. How can I stop that behavior and force a Save command
button to do that task?

Amazingly, I have spent years not knowing how to do this.

Change the form's Cycle property to "Current Record" and it won't advance to
a different record when you tab out of the last control. It will just cycle
again through the controls on the same record.

While a [Save] button is completely unnecessary you can certainly add one if
it makes you feel better. Just put...

Me.Dirty = False

....in its Click event. What is dangerous about this (or at least confusing)
is that this might give your users the impression that the record will
_only_ be saved if they press that button. If you present it as an
_additional_ way to save the record, then that is fine as all of the normal
events that trigger a save will still be there.
 
You can set the Cycle property of the form to Current record so that it does
not automatically advance to the next record when you tab out of the last
control on the form.

You can prevent Access from saving a completely blank record by opening your
table in design view, and setting the Required property to Yes for one of
the fields.

You can prevent the record from being saved only by cancelling the
BeforeUpdate event of the form, because there are so many ways to save a
record, e.g. Shift+Enter, Records | Save Record, toolbar buttons, navigation
buttons, applying a filter, changing sort order, closing the form, and so
on. So you will need to add a module-level boolean variable to the General
Declarations section of the form's module, set it to True in the Click event
of your button, and test and reset it in Form_BeforeUpdate. If the variable
is not True, the save was triggered by something else, so cancel the save.

In general, though that approach is extremely annoying for users, and
totally unnecessary. It usually means only that the developer did not
understand how to think event-driven, and work with (instead of against) the
events in Access.
 
Thanks for the advice guys. Did it and it's just what I need to do.

I'm working with an existing database that had a form that allowed them to
just advance after tabbing the last field. You should see the
records...aaaaack!!!......which is why I want them to be able to throroughly
look at what they've done before they go forward. These people are using
this when they're getting shipments and apparently they're chewing gum, if
you get the drift. They'll just go for the next package while they're
working on the same record. It just gives them some closure to make the
record "difficult".

Chew, put package on cart to go to recipient, next record, chew, get new
package, enter data, chew, put package on cart, next record. What a rythym.
 
Back
Top