Delete button on a Form

J

Jay

Am I right in thinking that if data is entered into a field on a form
then it saved as soon as the cursor is effectively moved to the next
field, even if the user hasn't moved to the next record?

The reason I ask is I am wanting to set up a simple form to collect
telephone call details. But I don't want the users to move from a
partially completed record and the partially completed record therefore
saved.

What I'm thinking of is having 2 command buttons at the bottom of the
form, One to add the record & move to an empty record ready for the next
call. And one to cancel the record they have started.

What is the simplest event I could use for the second button, so that
the fields in a partially completed record are cleared & not saved.

Any help appreciated.

Jason
 
R

Rick Brandt

Jay said:
Am I right in thinking that if data is entered into a field on a form
then it saved as soon as the cursor is effectively moved to the next
field, even if the user hasn't moved to the next record?

No. That will fire update events for the control, but the entry is not "saved
to disk" until you explicitly do so or leave the record.
The reason I ask is I am wanting to set up a simple form to collect
telephone call details. But I don't want the users to move from a
partially completed record and the partially completed record
therefore saved.

Then make all required fields "Required" in table design. Then records can only
be saved when all necessary fields have been populated.
What I'm thinking of is having 2 command buttons at the bottom of the
form, One to add the record & move to an empty record ready for the
next call. And one to cancel the record they have started.

There are so many ways that trigger an automatic save in Access that this
strategy has many problems. Better to properly train your users on how Access
works. Assume a save WILL happen unless they cancel the record using the
What is the simplest event I could use for the second button, so that
the fields in a partially completed record are cleared & not saved.

Me.Undo will cancel all pending changes, but if they have done anything that has
already saved some changes then a button like this can be confusing because it
will not always do what the user expects it to. This is especially true in a
form with a subform because saves occur every time you move to or from the
subform.
 
B

betwalk

Jay wrote:
....
What I'm thinking of is having 2 command buttons at the bottom of the
form, One to add the record & move to an empty record ready for the next
call. And one to cancel the record they have started.

What is the simplest event I could use for the second button, so that
the fields in a partially completed record are cleared & not saved...

Jason, you might want to consider using unbound forms. Then you can
have an "OK" button that adds the data to your table (via an append
query, for instance) and a "CANCEL" button that simply closes the
unbound form so no action is taken with the data.

Just a thought...

Betsy
 

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