Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub CloseOpenObjects()
Dim aobCurrent As AccessObject
For Each aobCurrent In [b]CurrentData[/b].[red]AllTables[/red]
If aobCurrent.IsLoaded Then
'The [i]ObjectType[/i] argument of the Close action needs to
'change depending on the Access Object Collection your
'working with
DoCmd.Close [red]acTable[/red], aobCurrent.Name
End If
Next aobCurrent
For Each aobCurrent In CurrentData.[blue]AllQueries[/blue]
If aobCurrent.IsLoaded Then
DoCmd.Close [blue]acQuery[/blue], aobCurrent.Name
End If
Next aobCurrent
'Notice the change from CurrentData to CurrentProject when the code moves
'from Data containers to UI components
For Each aobCurrent In [b]CurrentProject[/b].[green]AllForms[/green]
If aobCurrent.IsLoaded Then
DoCmd.Close [green]acForm[/green], aobCurrent.Name
End If
Next aobCurrent
'...AllPages
'...AllReports
'...
End Sub