UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> CloseDesignForms    

Function to loop all open forms and, if they're in design mode, close them. Default save behavior is to prompt for save.


' CloseDesignForms
' http://www.utteraccess.com/wiki/index.php/CloseDesignForms
' Code courtesy of UtterAccess Wiki
' Licensed under Creative Commons License
' http://creativecommons.org/licenses/by-sa/3.0/
' You are free to use this code in any application,
' provided this notice is left unchanged.
' rev  date                          brief descripton
' 1.0  2013-08-30                    
Function CloseDesignForms()
Dim frm As Object
Dim count As Long

count = 0
For Each frm In CurrentProject.AllForms
   If IsOpen(frm.Name, acForm) Then
       If frm.CurrentView = 0 Then
           DoCmd.Close acForm, frm.Name
           count = count + 1
       End If
   End If
   If count > 0 Then
       MsgBox (count & " forms closed")
       MsgBox ("No forms to close")
   End If

End Function

Creative Commons License
CloseDesignForms by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.

Edit Discussion
Custom Search

Thank you for your support!
This page has been accessed 3,076 times.  This page was last modified 09:32, 30 August 2013 by Jack Leach.   Disclaimers