Solved

Force explicit saving of Microsoft Access objects

Posted on 2007-03-20
6
225 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

628 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