Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

Closing forms in an event procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PRH - 19 Nov 2005 14:04 GMT
Can anyone tell me the correct code for closing all open forms using an event
procedure?
Rick Brandt - 19 Nov 2005 14:23 GMT
> Can anyone tell me the correct code for closing all open forms using an event
> procedure?

Sub CloseAllForms()

Dim i As Integer

For i = Forms.Count - 1 To 0 Step -1
   DoCmd.Close acForm, Forms(i).Name
Next i

End Sub

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

PRH - 19 Nov 2005 18:05 GMT
Thanks for the advice. I should have said that I want to leave the active
form open. How would this change the code?

> > Can anyone tell me the correct code for closing all open forms using an event
> > procedure?
[quoted text clipped - 8 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.