i am wanting to close all forms on timer event. all forms except one. also if any form is dirty then i do not want to even start running the vba.
i have seen a thread that gives me the code to close all forms except listed but im not sure about getting access to look at all the forms first, see if any are dirty then exit sub
the main reason for this is my staff sometimes do not log out. and for audit trails this can be bad. who's done what when and where.
the code for closing all forms
thanks
i have seen a thread that gives me the code to close all forms except listed but im not sure about getting access to look at all the forms first, see if any are dirty then exit sub
the main reason for this is my staff sometimes do not log out. and for audit trails this can be bad. who's done what when and where.
the code for closing all forms
Code:
'This code closes all open forms in the current project and then opens the named form in quotations
Dim obj As Object
Dim strName As String
For Each obj In Application.CurrentProject.AllForms
Debug.Print obj.Name
If obj.Name = "StartFilter" Then
Else
DoCmd.Close acForm, obj.Name, acSaveNo
End If
Next obj
thanks