Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Hidden attribute for a Query?

Status
Not open for further replies.

ordendelfai

Technical User
Nov 8, 2002
187
US
I want to be able to dynamically set the attributes property "Hidden" of a query through VBA code. So far, my research shows that it can be done for TableDefs, but I am having no luck with QueryDefs, nor any other method to change the Hidden value for a query. Anyone have a way to do it?

~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
RoyVidar gave me the clues to figure out a workaround, the thread is at:

Click

Prefacing a query with usys hides the query because Access thinks it is a system object.

I just put in some IF Statements with code that loops to make it work.

db.QueryDefs(QueryName).Name = "usys_" & QueryName

That Hides it

db.QueryDefs("usys_" & QueryName).Name = QueryName

That shows it again.



~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
I had wanted to do this for a long time, but never found a property in many, many fruitless searches. Then I ran across it in the Access 2000 Developer's Guide.

The Application object has GetHiddenAttribute and SetHiddenAttribute methods!

Who'd have thought it would be so easy? :)


Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I'll remember that for when my company ever upgrades to 2000 (still on 97..)



~Joel
As common courtesy and to help other members who might find your thread helpful in the future, please respond if the advice given resolved your issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top