Question : Hide all linked tables

I have this code I am using and would like to change to only hide linked tables and leave the native db tables visible...

Private Sub cmdHideAllObjects_Click()
    Dim tdf As TableDef
    Dim qdf As QueryDef

    For Each tdf In CurrentDb.TableDefs
        If tdf.name Like "msys*" Then
        Else
            If tdf.ATTRIBUTES = dblinkobject Then<<<<<<<<<<                tdf.ATTRIBUTES = dbHiddenObject
            Else
            End If
        End If
    Next tdf

    Set tdf = Nothing
End Sub

Answer : Hide all linked tables

Private Sub cmdHideAllObjects_Click()
    Dim tdf As TableDef
    Dim qdf As QueryDef

    For Each tdf In CurrentDb.TableDefs
        If tdf.name Like "msys*" Then
        Else
            If tdf.ATTRIBUTES = dbAttachedODBC  or tdf.attributes = dbAttachedTable  Then
                tdf.ATTRIBUTES = dbHiddenObject
            Else
            End If
        End If
    Next tdf

    Set tdf = Nothing
End Sub
Random Solutions  
 
programming4us programming4us