Solved

Force explicit saving of Microsoft Access objects

Posted on 2007-03-20
6
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

756 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