Hide Tables

  • Thread starter Thread starter tcb
  • Start date Start date
T

tcb

Tables can be hidden individually using this below. Is there a global
setting that would allow for all tables to be hidden?

Application.SetHiddenAttribute acTable, "tableName" , True
 
tcb said:
Tables can be hidden individually using this below. Is there a global
setting that would allow for all tables to be hidden?

Application.SetHiddenAttribute acTable, "tableName" , True


You can hide the whole database window (or navigation pane, for Access
2007), and in Access 2007 I believe you can decide what types of objects
will be seen on the navigation pane. But aside from that there is no global
setting to hide tables. You can write code to loop through the tables and
hide them all; something along these lines:

Dim ao As AccessObject

For Each ao In CurrentData.AllTables
If Left(ao.Name, 4) <> "MSys" Then
Application.SetHiddenAttribute acTable, ao.Name, True
End If
Next ao
 
Tables can be hidden individually using this below. Is there a global
setting that would allow for all tables to be hidden?

Application.SetHiddenAttribute acTable, "tableName" , True

Cycle through the TabelDefs and set the attribute of all non-system
tables.

Sub HideTables()
Dim tbf As TableDef
For Each tbf In CurrentDb.TableDefs
If Left(tbf.Name, 4) = "Msys" Or Left(tbf.Name, 1) = "~" Then
Else
Application.SetHiddenAttribute acTable, tbf.Name, True
End If
Next
End Sub
 
Cycle through the TabelDefs and set the attribute of all non-system
tables.

Sub HideTables()
Dim tbf As TableDef
For Each tbf In CurrentDb.TableDefs
If Left(tbf.Name, 4) = "Msys" Or Left(tbf.Name, 1) = "~" Then
Else
Application.SetHiddenAttribute acTable, tbf.Name, True
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top