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

Confirmation prompt after any change

P: 30
I am using Access2000/2002. When we make any change in the tables most of the time it goes in effect without any confirmation which is not good as someone can by mistake make changes which get permanent without notice.
Is there any way to get confirmation prompt after any change in the database.
thanks a lot for all the helph I get from this forum.

Jan 11 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 108
I can tell you how you would begin this, but I'm not sure how to finish it as I'm not sure how to stop a transaction. The initial part is fairly simple though I believe that you'll need to add a dialog box to the Before Update event of the form that will ask the user if they want to proceed. From here if they click cancel the changes will need to be undone and the form reset or selecting Ok will proceed.

Hope this helps.

- Minion -
Jan 11 '08 #2

Expert 2.5K+
P: 3,532
I'm concerned because you speak of when "we make any changes in the tables." If you're entering data directly into your tables you need to change this! There are a plethora of things you can't do, entering data in this manner, one of which is the very thing you're speaking of here. So if you are entering data directly into your tables, you need to modify your database by creating form(s) for data entry. You can do this very easily using the Forms Wizard.

If you are, in fact, entering your data thru forms, or after creating forms to do this, this code, placed in the form's code module, will ask users if they want to save changes and either save the changes or dump them:

Expand|Select|Wrap|Line Numbers
  1.   Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  If Not (Me.NewRecord) Then
  3.   If MsgBox("Would You Like To Save The Changes To This Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save Changes to Record ???") = vbNo Then
  4.    Me.Undo
  5.   End If
  6.  Else
  7.   If MsgBox("Would You Like To Save This Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save This Record ???") = vbNo Then
  8.    Me.Undo
  9.   End If
  10.  End If
  11.  End Sub
Welcome to TheScripts!

Linq ;0)>
Jan 11 '08 #3

P: 30
You guys are awesome...
Very helpful
Thanks a lot
Jan 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.