473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

No Save message display when closing the form

Hi.
When I create a new record, if I click on close, the window just close and no message appears asking if I want to save this record. Is there a way to force a message appear if user close the form? Thanks for any help. Michelle
Dec 14 '06 #1
4 1822
MSeda
159 Expert 100+
you can put the following code in the before update event for your form.


Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim result As Integer

result = MsgBox("Do You Want to Save the Changes?", vbYesNo)

If result = 7 Then
Me.Form.Undo
End If


End Sub
Dec 14 '06 #2
Thanks. It works. Mchelle
Dec 14 '06 #3
NeoPa
32,556 Expert Mod 16PB
Go to Tools / Options / Edit/Find / Confirm to see what you want to choose confirmations for.
These can be disabled and reenabled in VBA using
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.SetWarnings(False)
  2. and
  3. Call DoCmd.SetWarnings(True)
Dec 14 '06 #4
MSeda
159 Expert 100+
your very welcome
Dec 14 '06 #5

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

Similar topics

8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
2
by: deko | last post by:
I create an XmlDataDocument Dataset when the main form of my WinForms app opens. The user will make changes to the Dataset, and then those changes should be saved to the XML file when the code...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
12
by: Daniel Walzenbach | last post by:
Hi, I have a Website which allows users to input data. After they finished entering data they can click a button to save their input. Problem now is, that I have no possibility to visualize that...
1
by: Curtis | last post by:
I am having a problem with the coding below that someone was trying to help me with in another website. I have been to several websites and hopefully here I can get it resolved. I inherited this...
0
by: Patty05 | last post by:
I have a datagrid on a form that update properly when form loads. When the program runs and I type in/add a new row in the datagrid, it does not save the changes. Any help would be greatly...
2
by: rdemyan via AccessMonster.com | last post by:
I have a custom message form that I want to display when the user shuts down my app. Some clean up needs to be done during shutdown and I want to display this form and then display various...
2
by: Eric | last post by:
Hi, I have a form that requires a save button to be clicked before closing the form. I would like a msgbox to pop up when the button is not clicked before closing. Can someone show me how i...
8
by: csharpula csharp | last post by:
Hello, I am developing an application which gui is very rich with controls. My question is what is the best way to implement on c# a save require mechanism? I mean to check before closing the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.