Set tables hidden attribute from code

G

Guest

I have a library mdb that want to link a table to, through code. Upon
completion of the linking action, I want to set the tables hidden attribute.

I was using the transfer database action to do the linking but then realized
that it was not actually putting the link in the library mdb, but in the main
program mdb. When I was using this method, I used
Application.SetHiddenAttribute to hide the table.

I figured out how to create the tabledef in the library mdb, and point it to
the mdb/table that I want to link from. But I have not figured out how to
set the hidden attribute of the table once it is linked. I tried using
tdf.Attribute = XXXXX, where XXXX was a longint value that I got from that
attribute of a table that was actually linked, but that experiment failed
miserably.

Any help would be greatly appreciated.
 
D

Douglas J. Steele

The Attribute property actually usually holds the results of ORing together
multiple different values.

You're probably better off using

tdfAttribute = tdf.Attribute Or dbHiddenObject

or

tdfAttribute = tdf.Attribute + dbHiddenObject
 
D

Dirk Goldgar

Douglas J. Steele said:
The Attribute property actually usually holds the results of ORing
together multiple different values.

You're probably better off using

tdfAttribute = tdf.Attribute Or dbHiddenObject

or

tdfAttribute = tdf.Attribute + dbHiddenObject

I don't know if this is a good idea. Have they fixed this bug?

http://www.mvps.org/access/bugs/bugs0036.htm
Bugs: To Hide or Not To Hide

<quote>
To re-iterate the warning, if you add dbHiddenObject to any table's
Attributes, the table will be deleted during a compact operation.
</quote>
 
D

Douglas J. Steele

Dirk Goldgar said:
I don't know if this is a good idea. Have they fixed this bug?

http://www.mvps.org/access/bugs/bugs0036.htm
Bugs: To Hide or Not To Hide

<quote>
To re-iterate the warning, if you add dbHiddenObject to any table's
Attributes, the table will be deleted during a compact operation.
</quote>

Pretty sure that was Access 97 that acted up, and it was fixed in Access
2000 (or maybe even a service pack for 97)

I have to agree with you, though. I never hide objects that way (although I
occasionally will prefix their names with usys if I want them hidden)
 
D

Dale Fye

Thanks, guys.

I like the uSys idea Doug.

Dale

Douglas J. Steele said:
Pretty sure that was Access 97 that acted up, and it was fixed in Access
2000 (or maybe even a service pack for 97)

I have to agree with you, though. I never hide objects that way (although
I occasionally will prefix their names with usys if I want them hidden)
 

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