Close All Tables VBA Code


    Dim TableName As AccessObject
    With CurrentData
    For Each TableName In .AllTables
    If TableName.IsLoaded Then
    DoCmd.Close acTable, TableName.Name, acSaveYes
    End If
    Next TableName
    End With