Table attribute = Hidden

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
 
D

Dirk Goldgar

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
 
B

Boon

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)
 

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

Top