Save records ONLY if the save button is pressed.

G

Guest

I'm using a form and sub-form to both enter and display entries from a table.
I was able to set it up so that, on open, the form goes to the next record.
However, I only want to save the data in the new record when the save button
is pressed. If the user closes the form or X's out of it I want the record
to be dropped.

Also, it appears that a user can sometimes accidently modify an existing
record. I'm not sure how to explain how this is happening, but I was
wondering if its possible for the form to be set up to disregard any changes
to a record unless the save button is clicked?
 
R

Rick Brandt

DiSepe said:
I'm using a form and sub-form to both enter and display entries from
a table. I was able to set it up so that, on open, the form goes to
the next record. However, I only want to save the data in the new
record when the save button is pressed. If the user closes the form
or X's out of it I want the record to be dropped.

Also, it appears that a user can sometimes accidently modify an
existing record. I'm not sure how to explain how this is happening,
but I was wondering if its possible for the form to be set up to
disregard any changes to a record unless the save button is clicked?

With a form/subform it would not be easy because changes in the main form
are saved when you move focus to the subform and changes to the subform are
saved when you move focus to the main form (or to a different record in the
subform). In a single form you can use the BeforeUpdate event to give the
user a chance to cancel an automatic save, but in a form with a subform that
won't work very well.

Best to teach users how Access works and tell them NOT to mess with data
that they don't intend to save. You can set AllowEdits to No or lock
controls to prevent accidental changes.
 
G

Guest

Maybe I'm doing it all wrong; I'm just looking for a way to track and report
on student activities with one screen. The sub-form is basically used as a
display, not for data entry/modification. What I'm trying to do is give a
teacher the ability to select a student from a drop down list in the form and
enter a new activity while the sub-form displays a list the students past
activities.
 
R

Rick Brandt

DiSepe said:
Maybe I'm doing it all wrong; I'm just looking for a way to track and
report on student activities with one screen. The sub-form is
basically used as a display, not for data entry/modification. What
I'm trying to do is give a teacher the ability to select a student
from a drop down list in the form and enter a new activity while the
sub-form displays a list the students past activities.

So Make the subform read only. That can be done by setting its
RecordSourceType to "Snapshot". I don't understand how this realtes to
"Save records ONLY if the save button is pressed.". Why would the teacher
bother to type out the entry for a new activity and NOT want to save it?
Just tell them that records are automatically saved and if they change their
mind they can delete or edit the record again.
 
G

Guest

What's happening is a teacher will open the form, select the student from the
drop down and then for whatever reason decide to not complete the entry.
They close out of the form and the student is left with an empty record.
Even if I pull out the sub-form to eliminate that complication, I still need
to know how to stop the incomplete records from getting saved into the table.
 
G

Guest

Hey! Looks like all I needed to do was set each field in the table
associated with my form to be required. I also created a link to a separate,
read only form to display the student's past activities, that should resolve
both my issues. Thanks for your help!
 
R

Rick Brandt

DiSepe said:
What's happening is a teacher will open the form, select the student
from the drop down and then for whatever reason decide to not
complete the entry. They close out of the form and the student is
left with an empty record. Even if I pull out the sub-form to
eliminate that complication, I still need to know how to stop the
incomplete records from getting saved into the table.

Inform them that they can cancel a record that was started by pressing <escape>
twice.
 

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