Solved

Force explicit saving of Microsoft Access objects

Posted on 2007-03-20
6
218 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 - Access MVP) 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now