Table attribute = Hidden

  • Thread starter Thread starter Boon
  • Start date Start date
B

Boon

Hi,

I am using Access 2007.

I have about 20 tables. I want to change the attribute of these tables to
hidden.(right click on the table, then goto property, then make a checkmark
in front of the Hidden box.)

Is there a way to do this once without having to go into each of every 20
tables?

Thanks,
Boon
 
Boon said:
Hi,

I am using Access 2007.

I have about 20 tables. I want to change the attribute of these tables to
hidden.(right click on the table, then goto property, then make a
checkmark in front of the Hidden box.)

Is there a way to do this once without having to go into each of every 20
tables?


In code, you can call the Application.SetHiddenAttribute method. For
example,

Application.SetHiddenAttribute acTable, "FirstTableName", True
Application.SetHiddenAttribute acTable, "SecondTableName", True
Application.SetHiddenAttribute acTable, "ThirdTableName", True
' ...
Application.SetHiddenAttribute acTable, "TwentiethTableName", True

If you you want to hide all the tables in your database, you can write a
simple loop to do it, like this:

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
 
Thanks a lot Dirk!


Dirk Goldgar said:
In code, you can call the Application.SetHiddenAttribute method. For
example,

Application.SetHiddenAttribute acTable, "FirstTableName", True
Application.SetHiddenAttribute acTable, "SecondTableName", True
Application.SetHiddenAttribute acTable, "ThirdTableName", True
' ...
Application.SetHiddenAttribute acTable, "TwentiethTableName", True

If you you want to hide all the tables in your database, you can write a
simple loop to do it, like this:

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


--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
Back
Top