[AccessD] ...close open forms

DWUTKA at marlow.com DWUTKA at marlow.com
Thu Jan 19 10:33:48 CST 2006


Just curious, is this for the project with the Hidden Access functionality?

Drew

-----Original Message-----
From: William Hindman [mailto:wdhindman at bellsouth.net]
Sent: Thursday, January 19, 2006 6:32 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] ...close open forms


Gustav, Don, Lambert, Shamil, et al

...thanks to all who responded ...four different solutions all of which 
worked in different ways.
...why do I love AccessD? ...let me count the ways! :)

William

----- Original Message ----- 
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Thursday, January 19, 2006 4:42 AM
Subject: Re: [AccessD] ...close open forms


> Hi William
>
> OK, then adjust to skip the last opened (the opening) form:
>
> ' Close all forms except the first and last opened form.
>  For lngF = Forms.Count - 2 To 1 Step -1
>    DoCmd.Close acForm, Forms(lngF).Name, acSaveYes
>  Next
>
> /gustav
>
>>>> wdhindman at bellsouth.net 18-01-2006 23:15:07 >>>
> Gustav
>
> ...thanks ...wish it was that easy ...it does what you say but not what I
> need :(
>
> ...probably didn't explain it well enough ...it happens :)
>
> ...two or more forms open including the switchboard ...need it to close
> everything BUT the swb AND the opening form.
>
> ...your code ...in the on open event of opening form ...closes all but the
> swb ...including the opening form.
>
> ...suggestions welcome.
>
> William
>
> ----- Original Message ----- 
> From: "Gustav Brock" <Gustav at cactus.dk>
> To: <accessd at databaseadvisors.com>
> Sent: Wednesday, January 18, 2006 9:22 AM
> Subject: Re: [AccessD] ...close open forms
>
>
>> Hi William
>>
>> How about:
>>
>>  ' Close all forms except this first opened form.
>>  For lngF = Forms.Count - 1 To 1 Step -1
>>    DoCmd.Close acForm, Forms(lngF).Name, acSaveYes
>>  Next
>>
>> /gustav
>>
>>>>> wdhindman at bellsouth.net 18-01-2006 15:01:48 >>>
>> ...I need to close any open forms ...other than designated forms ...and
>> save
>> their data ...before opening a called form ...from the called form.
>>
>> ...ie call a form open from a switchboard ...the called form checks for
>> any
>> other forms open, other than the sb, and closes them, saving their data,
>> before it opens.
>
>
> -- 
> 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