By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Help! Access automatically saves any changed data on tables

P: n/a
how do you stop Access from saving any changed data in your tables and
queries?
like i just add or change data on the table/query tables,then click on
X (exit)because i have no intention of saving it but access still
automatically saves it even if I did not press the save command on the
menu/toolbar? What is the solution for this? help thanks!
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
The Save command on the toolbar is to save structural changes to objects in
your database, not for saving data. There is another command that will save
a record on demand. The behaviour you mention is by design. Access will save
any changes when you leave the current record, whether that be to go to
another record or by closing the form, query, or table. In a form, you can
do something to abort this behaviour. In the Form's BeforeUpdate event, you
can prompt to save changes and give the use the option to cancel. However,
this will happen for every record change.

Example:
If MsgBox("Save Change?", vbYesNo+vbQuestion)=vbNo Then
Cancel = True
Me.Undo
End If

Also, in the Form's Error event you will need the following:
If DataErr = 2169 Then Response = acDataErrContinue

--
Wayne Morgan
MS Access MVP
"Christopher Koh" <ch******@yahoo.com> wrote in message
news:2f*************************@posting.google.co m...
how do you stop Access from saving any changed data in your tables and
queries?
like i just add or change data on the table/query tables,then click on
X (exit)because i have no intention of saving it but access still
automatically saves it even if I did not press the save command on the
menu/toolbar? What is the solution for this? help thanks!

Nov 13 '05 #2

P: n/a
thanks for helping me out Wayne, now I know
btw what does If DataErr = 2169 Then Response = acDataErrContinue mean?
"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<w%***************@newssvr24.news.prodigy.com >...
The Save command on the toolbar is to save structural changes to objects in
your database, not for saving data. There is another command that will save
a record on demand. The behaviour you mention is by design. Access will save
any changes when you leave the current record, whether that be to go to
another record or by closing the form, query, or table. In a form, you can
do something to abort this behaviour. In the Form's BeforeUpdate event, you
can prompt to save changes and give the use the option to cancel. However,
this will happen for every record change.

Example:
If MsgBox("Save Change?", vbYesNo+vbQuestion)=vbNo Then
Cancel = True
Me.Undo
End If

Also, in the Form's Error event you will need the following:
If DataErr = 2169 Then Response = acDataErrContinue

--
Wayne Morgan
MS Access MVP
"Christopher Koh" <ch******@yahoo.com> wrote in message
news:2f*************************@posting.google.co m...
how do you stop Access from saving any changed data in your tables and
queries?
like i just add or change data on the table/query tables,then click on
X (exit)because i have no intention of saving it but access still
automatically saves it even if I did not press the save command on the
menu/toolbar? What is the solution for this? help thanks!

Nov 13 '05 #3

P: n/a
If you cancel the update while trying to close the form you'll get a data
error saying something like, "the data can't be save right now, do you wish
to cancel the update?". The error number for this error is 2169. Since it is
a data error, not a runtime error, you have to trap this error in the form's
Error event. The Response = acDataErrContinue just tells Access to ignore
the error and continue. In this case, it results in you not being prompted
and the form closes.

--
Wayne Morgan
Microsoft Access MVP
"Christopher Koh" <ch******@yahoo.com> wrote in message
news:2f************************@posting.google.com ...
thanks for helping me out Wayne, now I know
btw what does If DataErr = 2169 Then Response = acDataErrContinue mean?
"Wayne Morgan" <co***************************@hotmail.com> wrote in

message news:<w%***************@newssvr24.news.prodigy.com >...
The Save command on the toolbar is to save structural changes to objects in your database, not for saving data. There is another command that will save a record on demand. The behaviour you mention is by design. Access will save any changes when you leave the current record, whether that be to go to
another record or by closing the form, query, or table. In a form, you can do something to abort this behaviour. In the Form's BeforeUpdate event, you can prompt to save changes and give the use the option to cancel. However, this will happen for every record change.

Example:
If MsgBox("Save Change?", vbYesNo+vbQuestion)=vbNo Then
Cancel = True
Me.Undo
End If

Also, in the Form's Error event you will need the following:
If DataErr = 2169 Then Response = acDataErrContinue

--
Wayne Morgan
MS Access MVP
"Christopher Koh" <ch******@yahoo.com> wrote in message
news:2f*************************@posting.google.co m...
how do you stop Access from saving any changed data in your tables and
queries?
like i just add or change data on the table/query tables,then click on
X (exit)because i have no intention of saving it but access still
automatically saves it even if I did not press the save command on the
menu/toolbar? What is the solution for this? help thanks!

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.