Solved

Force explicit saving of Microsoft Access objects

Posted on 2007-03-20
6
222 Views
Last Modified: 2008-03-06
In Microsoft Acess 2003 I recently have found that changes that I make to objects during testing are actually saving to the application even though I am not explicitly saving them.

This is introducing bugs.

Could someone advise me on how to switch this behaviour off.  It has only recently started to do this.

Regards
0
Comment
Question by:Greenbase
  • 4
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 18761358
Check to be sure that you do not have ... some where in VBA code or a macro a >>

DoCmd.SetWarnings False    without a DoCmd.SetWarnings True afterward.  That will cause you NOT to be prompted for a SAVE .... forms, reports ... objects in general.

mx
0
 
LVL 75
ID: 18761380
Further ... it's easy to forget this ... or ... maybe a error occurred running some code wherein there was a DoCmd.SetWarnings False ... and you had a 'break' in the code ... and a DoCmd.SetWarnings True that you may have had .. never got executed.  So ... if then, for example ... you started working on a form object ... made some changes ... decided NOT to Save ... closed the form ... they WILL get saved without any prompt!

mx
0
 
LVL 75
ID: 18761523
Sorry ... one more clarification on the first post.  What I mean is ... suppose some code runs.  Then you open a form/report in design view and make some changes ... decide not to Save ... and close the form/report.  If a DoCmd.SetWarnings False was executed w/o a corresponding DoCmd.SetWarnings False ... then this situation can arise.

However ... if you close Access and re-open ... I believe that is reset.  So ... if this is not the problem ... then, can you be more explicit (no pun) as to what is happening?

mx

0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 1
ID: 18761572
One thing I am learning through painful experience, is do not make program changes, while the program is in break mode. It's very tempting to step through code in the debugger, decide to make a quick minor change and continue executing. Most of the time I lose my change, when I look at it later.

Access also seems to have a number of limitations with how it handles updates to the form's module whilst the program is in 'run' mode, that is the form being displayed in 'Form View' even if no methods within the module are being executed at the time.

Also as per other posts, the Warnings mode is a pain.

Also, I have added the explicit prompt to all my Close buttons.
DoCmd.Close acForm, me.Name, acSavePrompt

You may also experiment with hooking the OnClose event for the form -> Form_Close()



0
 
LVL 1
ID: 18761578
Also, if you are truly doing testing only, don't use your production system!!!

0
 
LVL 75
ID: 18761603
That SURE IS a looooooooooooooong user name, lol.

Relative to what you said ... sometimes you have a break point ... do whatever ... close the form and/or Access ... reopen Access and say a form ... and suddenly that break point activates!  THAT's always fun ... a case of the Stuck Breakpoint !  *Usually* ... rebooting clears that out!

mx
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question