Solved

Force explicit saving of Microsoft Access objects

Posted on 2007-03-20
6
224 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

710 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