[AccessD] Close All Forms

Jim Lawrence accessd at shaw.ca
Fri Aug 19 16:32:09 CDT 2005


It wouldn't be because you have just closed the form that you are on or have
called this function from and the system is having a problem getting back??

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Barbara Ryan
Sent: Friday, August 19, 2005 12:11 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Close All Forms

It dies after the "End Function" line is executed.


----- Original Message ----- 
From: "Josh McFarlane" <darsant at gmail.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Friday, August 19, 2005 2:50 PM
Subject: Re: [AccessD] Close All Forms


> On 8/19/05, Barbara Ryan <BarbaraRyan at cox.net> wrote:
> > I have used the following code successfully in Access 97 to close all
forms when a specific function key is pressed.  However, in Access 2002,
this code causes the error box to appear (with the 2 options to send an
error report to Microsoft or not) and then closes Access.  Does anyone know
why?
> >
> >     Function CloseAllForms()
> >         Dim i As Integer
> >         ' Loop through the collection of open forms and close them
(except for the main menu)
> >         If Forms.Count > 0 Then
> >             For i = Forms.Count - 1 To 0 Step -1
> >                 If Forms(i).Name <> "frmMainMenu" Then
> >                     DoCmd.Close acForm, Forms(i).Name
> >                 End If
> >             Next i
> >         End If
> >     End Function
>
> Can you trace the specific line that it dies on? (IE Set a breakpoint
> on DoCmd and see if it ever fires for each form.)
>
> -- 
> Josh McFarlane
>
> "Peace cannot be kept by force. It can only be achieved by understanding."
> -Albert Einstein
> -- 
> 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