Re: Strange Problems with VBA

From: Jim Vierra (jvierra_at_msn.com)
Date: 01/26/05


Date: Wed, 26 Jan 2005 14:32:20 -0500

If you open a form (run a form) it will be saved in memory unless you
destroy it. This causes a conflict when you try to rename a form to the
name of a previously deleted but once activiated form. Find the form in the
"Forms" collection or run the test form and save a reference to the object
globaly or in a global collection. Then after closing the form and deleting
it you can find the reference and destroy the form and set it's reference to
Nothing.

You must be sure that no other form has been run that contains a reference
to the form you are trying to replace.

-- 
Jim Vierra 661815
"David C. Holley" <DavidCHolley@netscape.net> wrote in message 
news:eq8uba6AFHA.3592@TK2MSFTNGP11.phx.gbl...
> Additional information...
> The modules containing the FORM-related code are not being deleted when I 
> delete the forms from the DB. This occurred in a freshly created *.mdb 
> file.
>
> David H
>
> David C. Holley wrote:
>> Something weird is going on. I was in the process of debuging a form 
>> (frmReservations) in Access. As a part of this, I created a copy of the 
>> form (frmReservations_backup). Once I had figured out the problem with 
>> the original. I deleted it and then went to rename the _backup to the 
>> original. At first, Access really didn't like that indicating that a form 
>> by that name already existed, although I had deleted it and it didn't 
>> appear in the DB window. Then when I tried to view the VBA code for the 
>> backup, Access started through an error message - "Error accessing code. 
>> The connection to the network might have been lost."
>>
>> I did a compact and repair on the db file, which didn't work. I then 
>> imported the form into a fresh db file, which seemed to fix the problem, 
>> but then when I started working with a function in a module that I 
>> exported and imported, Access would throw the error message at me when I 
>> tried to ADD parameters to a sub.
>>
>> I've already done a uninstall/reinstall of ALL of Office on the chance 
>> that this would fix it, but it didn't.
>>
>> I think that the problem possibly has something to do with specific DB 
>> files as opposed to Access and may just flat out import/export everything 
>> (ARGGGG!!!) but its just plain strange.
>>
>> Any ideas?
>>
>> FYI: Office 2000 Pro on WinXP
>>
>> David H
>> Come on baby lite my fire: www.spreadFirefox.com 


Relevant Pages

  • Re: does python have useless destructors?
    ... >> between disposing at the end of the function or when some containing ... and in CPython that happens at the moment the last reference is ... C Python destroys an object when no references are left. ... IronPython destroy objects when the underlying garbage collector feels like ...
    (comp.lang.python)
  • Re: Application crashes on handled error. Why?
    ... but terminate events on those objects are not fired. ... call no more than one method and destroy immediately. ... >> I am not too happy about zapping a reference to a Parent in a Child ...
    (microsoft.public.vb.general.discussion)
  • Re: devctl (alike?) for devfs
    ... Typical holder of the reference is the devfs vnode. ... ls did trigger DESTROY notifications. ... I slightly don't like a fact that parent-child destroy notifications ...
    (freebsd-hackers)
  • Re: Function Returning a local object???
    ... > class MFVec { ... > MFVec(float x, float y); ... not destroy it). ... a invalid reference. ...
    (comp.lang.cpp)
  • Re: copy contructor
    ... "" and forget to put it in DESTROY, whereas my approach would look like: ... the memory leak isn't the worst problem. ... That's indeed a minor problem. ... Inside-Out object work because every the memory address of every reference ...
    (comp.lang.perl.misc)