Re: DoCmd.Close and DoCmd.DeleteObject

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Daniel Magnus Bennét Björck (Daniel.Bjorck_at_dk.dhl.com)
Date: 05/21/04


Date: Fri, 21 May 2004 11:02:44 +0200

Hi!

Recreating the database does not make a difference unfortunately. It is
still consistently not deleting forms that were previously opened, but has
no problems with the ones that weren't open. Could it be that as the form to
be deleted was open when the second form was opened, the second form still
somehow thinks it's open even though it has closed it? Perhaps there is some
system command to run after DoCmd.Close to ensure that the second form sees
that the first form really was closed?

I put in a snippet in the timer event to record when it was firing, and it
is not firing after the form has been closed. And interestingly, if I choose
End from the debug mode, I have no problems deleting the form manually!

Brgds

Danny

"TC" <no@email.here> wrote in message
news:40ac07b5$1_4@news.chariot.net.au...
> If you're positive that the form in question is closed, and not running a
> timer event, and you still can't delete it, the only other thing that I
can
> think of, is that the database is corrupt. Try importing all the objects
> into a new db, & see if that fixes it.
>
> You said originally: "As long as the form hasn't been previously opened,
it
> [the delete] works fine". Is that still true (after importing into a new
> db)?
>
> HTH,
> TC
>
>
> "Daniel Magnus Bennét Björck" <Daniel.Bjorck@dk.dhl.com> wrote in message
> news:ujHQ9YXPEHA.2704@TK2MSFTNGP10.phx.gbl...
> > Hi!
> >
> > Yes, it is trying to delete other forms, not itself.
Compacting/repairing
> > does not help.
> >
> > Brgds
> >
> > Danny
> >
> > "TC" <no@email.here> wrote in message
> > news:40aae0ec$1_2@news.chariot.net.au...
> > > You're sure that the upgrade form is not accidentally trying to delete
> > > itself? (hence the message)
> > >
> > > If not, perhaps compact the database & try again.
> > >
> > > HTH,
> > > TC
> > >
> > >
> > > "Daniel Magnus Bennét Björck" <Daniel.Bjorck@dk.dhl.com> wrote in
> message
> > > news:uJfKLgKPEHA.308@TK2MSFTNGP11.phx.gbl...
> > > > Hi!
> > > >
> > > > I have an upgrade form which replaces forms in the current database
> with
> > > new
> > > > versions from another database. However, when I try to delete an old
> > form
> > > > using DoCmd.DeleteObject, I get an error message saying that the
form
> is
> > > > still open; even though I've used DoCmd.Close on it, and it does
> indeed
> > > fire
> > > > and complete the Close event on that form, and it doesn't show on
the
> > > screen
> > > > anymore, and an IsFormLoaded function I've picked up somewhere does
> also
> > > say
> > > > that it is indeed closed.
> > > >
> > > > As long as the form hasn't been previously opened, it works fine. Is
> > there
> > > > something I'm missing about closing forms? For instance, two forms
I'm
> > > > particularly having problems with are using Timer events, could it
be
> > that
> > > > they are still running in some form even though the form is closed??
> Or
> > > > could there be some problem with DeleteObject, in which case, is
there
> > > > another way of deleting forms I could try??
> > > >
> > > > Brgds
> > > >
> > > > Danny
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Linking Forms
    ... I simply name a field on the first form Username to get the input? ... I'm assuming that ASP pages will behave differently then these ... I presume you are using the frontpage wizard to do the database inputing. ... want to be seen on the second form can be collected in a hidden form field ...
    (microsoft.public.frontpage.client)
  • RE: Push Method - overwriting data
    ... If you are deleting records at the SqlCe Database, ... SQL Server and inserting the new records. ...
    (microsoft.public.sqlserver.ce)
  • Re: Subform not allowing edits?
    ... Creating and deleting fields. ... It's just possible that Name AutoCorrect is ... Make sure the boxes are unchecked under ... the database may be corrupting? ...
    (microsoft.public.access.forms)
  • Re: Linking Forms
    ... I presume you are using the frontpage wizard to do the database inputing. ... want to be seen on the second form can be collected in a hidden form field ... intervening confirmation page - without a Form and its required Submit ... but now the fields originally named and captured on the first form ...
    (microsoft.public.frontpage.client)
  • Re: RE and Cascade Deletes
    ... all you get is a lousy message saying ... this database and delete the entire database ... working hard to prevent gaffs like this if a simple "Yes" sends you deleting ...
    (comp.databases.ms-access)