[AccessD] Access 2002 - Another way to lose your work

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed Sep 24 04:49:43 CDT 2008


<<<
I still cannot figure out why the one object 
(a form) got saved, and all the other
changes (to code modules) got blown away.
>>>
Hi Lambert,

My guess is that form belongs to your FE mdb, and modules were from library
mdb?

Since MS Access 2000 AFAIKR (for sue that wasn't the case for MS Access 97)
if you debug/trace/edit your library mdb VBA code and try to save it then
you in fact save nothing...

I always keep VBA code from mdb library modules copied and pasted and saved
manually in text code files and after I quit my debug session I do open text
files and copy over the code in VBA modules - well, I must say almost didn't
do that stupid work anymore as I'm mainly working with .NET - this "feature"
of getting VBA code from library MDB lost is one of the main "no-go" with
serious VBA code development anymore...

To workaround the issue effectively (as MS is very probably not going to fix
that issue as VBA team doesn't exist there anymore or exists just to support
existing features AFAIU) - to workaround the issue effectively it would be
useful to have a COM add-in to be called by hot-key from VBA window to save
current (-ly opened) modules' code into text files, and have additional
feature to replace code in modules (including class/forms/reports modules of
course) from saved in text files...

But beware! - when I did try to do something like that with MS Excel VBA
projects - I mean replacing code modules using text files - I did end up in
constant GPFing of MS Excel VBA projects - no workaround...

For MS Access VBA - it usually works well but still one can get their mdb
broken - always keep a back-up copy in safe place when you do (mass) replace
of code in your VBA modules...

--
Shamil

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert
Sent: Tuesday, September 23, 2008 10:57 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Access 2002 - Another way to lose your work

No good I'm afraid. Directly after opening an MDB file ? SetWarnings
returned a blank line. 

If I then type DoCmd.SetWarnings False, then ? SetWarnings still returns a
blank line.

If I type DoCmd.SetWarnings True, then ? SetWarnings still returns a blank
line.

As for my lost work, the fact that the list of changed objects opened up
when I hit the save button tells me that SetWarnings was True, but I still
cannot figure out why the one object (a form) got saved, and all the other
changes (to code modules) got blown away.

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee
Sent: Tuesday, September 23, 2008 2:15 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2002 - Another way to lose your work

You can go into the immediate window and type ? SetWarnings

should return blank/nothing or False


On Tue, Sep 23, 2008 at 10:02 AM, Heenan, Lambert
<Lambert.Heenan at aig.com>wrote:

> Cross posted to Access-L and Access-D
>
> Ever seen this happen? I just lost 90 minutes of work this morning...
>
> The scenario was I had a couple of modules open, and a form module, 
> and another from. Had a few bookmarks set to a could jump between 
> modules/functions.
>
> After working on one of the forms I hit the Save button and I got the 
> usual listbox showing the altered objects in my project. I deselected 
> all the objects other than the form I wanted to save at that point and 
> then when I returned to an open module the first thing I noticed was 
> that I had no bookmarks set anymore. The next thing I noticed was that 
> all the code I had just written had vaporized. Aaargghh!!!
>
> The only think I can think of that might cause this is that 
> SetWarnings may have been set to False, but why, when I did not close 
> any of the altered objects, did my changes get blown away?
>
> Any way to tell in code if SetWarnings = False?
>
> Lambert
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list