A
ambushsinger
How can I hide all of the tables in my database programmatically?
kc-mass said:Hi,
Try these routines to hide and unhide your tables:
Sub HideAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= dbHiddenObject
End If
Next lngTable
End Sub
Sub ShowAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= 0
End If
Next lngTable
End Sub
Regards
Kevin
.