Keeping queries hidden

  • Thread starter Thread starter Jessica
  • Start date Start date
J

Jessica

Greetings!

I want to hide many of my queries from view, so I set the
Attributes to Hide, under their properties. They remain
hidden until they are run and then they are visible
again. I want them to remain hidden even after being
run.
I think the problem comes from the fact that I am creating
these queries 'on the fly' through forms that supply the
information needed to build the SQL string for the query
in a module. The sql string is then set to the query
using:

CurrentDb.QueryDefs("Query_Name").SQL = strSQL

And I open the query with:
DoCmd.OpenQuery "D_CPUE_1"

Once the query is opened in this method it has reset its
Attributes to the default where it is visible again. Is
there any code out there to set the query to always be
hidden and not visible?

thanks!

Jessica
 
In Access 97, there was a bug that setting the attributes
to hidden via code would cause the item to be deleted the
next time the database is compacted.

Another option is to start the name of the query with USYS.

This causes the query to be considered a system object,
and will not be displayed unless the user has selected the
option of View System Tables.


Chris Nebinger
 
(snip)
In Access 97, there was a bug that setting the attributes
to hidden via code would cause the item to be deleted the
next time the database is compacted.

That was never a bug. dbHiddenTable (or whatever it is) was an undocumented
system value that people discovered, and >assumed< could be used for hiding
tables. That assumption was understandable - but incorrect! That value was
never doc'd as being available for end-user consumption (afaik).

Cheers,
TC
 
Bug or not, it did hide the tables, and they were still
there. Upon compacting, they were gone.

Either way, it is not to be used to hide tables. The USYS
method is a better method.


Chris Nebinger
 
Back
Top