Access 2007 Property for visible tables in navigation pane?

B

Balbina

I have a form with a list box. I would like the list box to load the tables
from my database that are visible in the Navigation pane. Where is this
property set? I have tried the AllTables collection, but the table properties
are not available. And I tried this:

Dim cat As adox.Catalog
Set cat = New adox.Catalog

cat.ActiveConnection = CurrentProject.Connection

Dim i As Integer

With cat.Tables
For i = 0 To (.Count - 1)
If .Item(i).Properties(9).Value = False Then
Me.lstTables.AddItem .Item(i).Name
End If
Next i
End With

Where Properties(9).name = Jet OLEDB:Table Hidden In Access
and where lstTables is my list box on my form.

This lists most of the tables because, I'm guessing, that property is for
something else. Any thoughts?

Thank you,

Balbina
 
D

Dirk Goldgar

Balbina said:
I have a form with a list box. I would like the list box to load the tables
from my database that are visible in the Navigation pane. Where is this
property set? I have tried the AllTables collection, but the table
properties
are not available. And I tried this:

Dim cat As adox.Catalog
Set cat = New adox.Catalog

cat.ActiveConnection = CurrentProject.Connection

Dim i As Integer

With cat.Tables
For i = 0 To (.Count - 1)
If .Item(i).Properties(9).Value = False Then
Me.lstTables.AddItem .Item(i).Name
End If
Next i
End With

Where Properties(9).name = Jet OLEDB:Table Hidden In Access
and where lstTables is my list box on my form.

This lists most of the tables because, I'm guessing, that property is for
something else. Any thoughts?

Thank you,

Balbina


You can use the Application.GetHiddenAttribute method to find out whether a
particular table's Hidden attribute is set. For example:

'------ start of example code ------
Dim ao As AccessObject

For Each ao In CurrentData.AllTables
If ao.Name Like "MSys*" Then
' skip system tables
Else
If Application.GetHiddenAttribute(acTable, ao.Name) = False Then
Me.lstTables.AddItem ao.Name
End If
End If
Next ao
'------ end of example code ------
 
B

Balbina

Thank you for the suggestion, unfortunately, it does not catch user defined
hidden tables. For example, I have designated "Switchboard Items" to be
'Hidden in this Group' but its GetHiddenAttribute property is still False.

Balbina
 

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