473,327 Members | 2,055 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,327 software developers and data experts.

Close Without Save

I have a form with 6 subforms in Access 2003 with two command buttons at the bottom of the form. When I add data into 2 of the forms and click "Exit with No Save" these two forms retain their data. However, one of the subforms is entirely comprised of Check boxes and when I open an existing record and click on any of the boxes the main form closes but retains the data of only the first one selected. The other subform has an attachment command button and always saves when clicked on "Exit with No Save". Maybe the reason is geared towards the entry screens in question being subforms. Any ideas?
Feb 28 '07 #1
4 6182
Rabbit
12,516 Expert Mod 8TB
Naming a button Exit Without Save doesn't do anything unless you have code behind it. You'll need to either delete the record or undo the changes.
Feb 28 '07 #2
Naming a button Exit Without Save doesn't do anything unless you have code behind it. You'll need to either delete the record or undo the changes.
This is all my close without save command button has in it:
Expand|Select|Wrap|Line Numbers
  1.     Private Sub cmdCloseNoSave_Click()
  2.     DoCmd.Hourglass True
  3.         Select Case MsgBox("You are about to close the form without saving your changes.  Are you sure you want to do this?", vbExclamation + vbYesNo, "Close without Saving")
  4.         Case vbYes
  5.             Me.Undo
  6.             Me.Dirty = False
  7.             DoCmd.Close
  8.         Case vbNo
  9.  
  10.         End Select
  11.     DoCmd.Hourglass False
  12. End Sub
Why do you think it would be saving?
Feb 28 '07 #3
NeoPa
32,556 Expert Mod 16PB
Maybe you need to execute the Undo on the main form as well as all the subforms.
Mar 1 '07 #4
Maybe you need to execute the Undo on the main form as well as all the subforms.
I will try that, thank you!
Mar 1 '07 #5

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

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
9
by: Steven Malcolm | last post by:
Hello there Is it possible to close a window without the messagebox coming up asking if you really want to close the window? Steven
6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
4
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
4
by: Pierke | last post by:
Hey guys out there, I really need your help, i am building up a web site, so for security reasons i need to do "some things" before the user log off, and i indeed do it. Now the matter is that...
2
by: Ivan Jericevich | last post by:
I changed some bindings and made a real mess, I would like to close the project and reload from my last save. How do I close the project withot it saving in it's current state of mess.
5
by: jimmy | last post by:
Hi all, I want to capture the event when the browser's close button is clicked in an html page. I tried using the event.ClientX and event.ClientY property in the body unload event, and this...
2
by: jayasabari | last post by:
Hai, I am opening the popup window using java script. i want to close the popup window without asking save message. Can you give any suggestion.. Regards, K.Jayasabari
1
by: if1467 | last post by:
This may be a very simple question, but its got me stuck. I am trying to write a macro for excel and a part of it opens another workbook, manipulates and extracts data from it and then closes the...
3
by: Kelii | last post by:
I've been beating my head against this problem for the last several days, and I haven't found a decent solution yet. So I'm turning to the group for some moral support or better yet some answers. ...
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: 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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.