N
Nick 'The database Guy'
Hi People,
I am using the following code to iterate through the forms ,reports,
macros (tsk tsk), and modules and close them down before exiting the
db. My problem is there is no AllTables or AllQueries object within
CurrentProject. How do I iterate through them?
Public Sub CloseAllOpenWindows()
Dim window As Variant
For Each window In CurrentProject.AllMacros
DoCmd.Close acMacro, window.Name
Next
For Each window In CurrentProject.AllReports
DoCmd.Close acReport, window.Name
Next
For Each window In CurrentProject.AllForms
DoCmd.Close acForm, window.Name
Next
For Each window In CurrentProject.AllModules
DoCmd.Close acModule, window.Name
Next
End Sub
TIA
Nick
I am using the following code to iterate through the forms ,reports,
macros (tsk tsk), and modules and close them down before exiting the
db. My problem is there is no AllTables or AllQueries object within
CurrentProject. How do I iterate through them?
Public Sub CloseAllOpenWindows()
Dim window As Variant
For Each window In CurrentProject.AllMacros
DoCmd.Close acMacro, window.Name
Next
For Each window In CurrentProject.AllReports
DoCmd.Close acReport, window.Name
Next
For Each window In CurrentProject.AllForms
DoCmd.Close acForm, window.Name
Next
For Each window In CurrentProject.AllModules
DoCmd.Close acModule, window.Name
Next
End Sub
TIA
Nick