473,490 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to turn off autosave?

Seth Schrock
2,965 Recognized Expert Specialist
I'm trying to make it so that if I leave a record without saving it, the changes aren't saved. A message asking if you want to save the changes would be nice. I just don't want someone to accidentally make a change and then go onto the next record and the information is saved. From what I have been reading online, I'm guessing that I need something in the BeforeUpdate event, but I don't know what. I'm using Access 2010.
Jan 25 '11 #1
6 8094
ADezii
8,834 Recognized Expert Expert
Something alone these lines should work:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. Dim strMsg As String
  3. Dim intResponse As Integer
  4.  
  5. strMsg = "You have made one or more changes to this Record. Do you wish to Save this Record " & _
  6.          "with those changes?" & vbCrLf & vbCrLf & "Click Yes to Save changes, or Cancel to " & _
  7.          "UNDO these changes?"
  8.  
  9. intResponse = MsgBox(strMsg, vbQuestion + vbOKCancel + vbDefaultButton1, "Promopt to Save Record")
  10.  
  11. If intResponse = vbCancel Then
  12.   DoCmd.RunCommand acCmdUndo
  13. End If
  14. End Sub
Jan 30 '11 #2
Seth Schrock
2,965 Recognized Expert Specialist
Will this make it so that for each field you will have to hit yes, or when you try to leave the current record all fields will be saved or not?
Jan 30 '11 #3
ADezii
8,834 Recognized Expert Expert
For the Current Record.
Jan 30 '11 #4
Seth Schrock
2,965 Recognized Expert Specialist
Thank-you so much. I will try it when I get to work tomorrow and see what I get.
Jan 30 '11 #5
Seth Schrock
2,965 Recognized Expert Specialist
It worked perfectly. Thank-you so much.
Jan 31 '11 #6
ADezii
8,834 Recognized Expert Expert
You are quite welcome.
Jan 31 '11 #7

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

Similar topics

1
2693
by: p-nut | last post by:
newbie here needing some help. Is there a way to set up a script that will check a pop3 account and autosave the file attachments to a folder specified? The thing is: I have 1 single email...
2
8974
by: scorp7355 | last post by:
I was wondering if there is some other way to turn autocomplete off besides using "autocomplete=off", using a meta tag or something similar. It would be great if there is some way to turn it off...
2
6813
by: deko | last post by:
I want to turn error handling off, then back on in a sub routine that backs up a select set of documents. For some reason, I can't seem to get this to work - Private Sub BackupDocs() On Error...
3
2202
by: ilushn | last post by:
Help! I am having a very aggervating problem with Access. Call me lazy, but I like to copy and paste addresses from Access into microsoft work, like for sending letters where I only need about 3...
7
2598
by: jaYPee | last post by:
I am using dataset as a datasource for my datagrid. I'm wondering how to program to autosave the changes made in a datagrid just like microsoft access. any help is greatly appreciated.
2
2316
by: Groove | last post by:
Hey guys - I've used the Thread.Sleep(xyz) method before to trigger a pause in a sub or function. I was wondering if anyone knew of a method to have a page autosave itself after X minutes? ...
3
2296
by: John Wright | last post by:
I want to create an autosave and crash recovery module for my program. I imagine I would have to use a timer control on the form to call the autosave functionality but I need a starting point. I...
1
1537
by: prinsipe | last post by:
hi all, how can i autosave edited values from my datagrid when the user moves from page to page? i am using template column, textbox is used in item for the user to update the values. is...
2
1780
by: yuvang | last post by:
I have one MDB which is located in server and so many persons are accessing and adding data to that mdb. Here is my doubt 1. is ms access has autosave option? 2. If yes, in what time interval it...
2
2284
by: tommy1999 | last post by:
Hi all! I am working on a turn based web game in PHP5. This is pretty simple game, a kind of board game: two people join a "session" and they play until one of them wins. My problem in...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.