Closes the window of an Access object: DoCmd.Close([ObjectType][, ObjectName][, Save])
Public Sub CloseTables()
Dim tbls As AllTables
Dim tbl As Variant
Set tbls = Access.Application.CurrentData.AllTables
For Each tbl In tbls
If tbl.IsLoaded Then
If vbYes = msgBox("Close " & tbl.Name & "?") Then
DoCmd.Close acTable, tbl.Name, acSavePrompt
End If
End If
Next
End Sub
Related examples in the same category