By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Hiding Queries

P: n/a
Hello

I am using MSACCESS 2000

I can hide Tables from appearing in the Database Window with the following
code:

For Each tbldef in MyDB.TableDefs
tbldef.Attributes = dbHiddenObject
Next tbldef

How can I do the same with the Queries, to hide them in the Database Window?

Or how can I prevent someone from importing Queries in MDB1 from MDB2 when
this someone belongs to the same
Work Group as MDB1and has Open/Run permission on MDB1.?

By hiding the Tables in MDB1 it looks as if importing through the import
wizards (under File in MSACCESS) is impossible
and I would like this to also be the case for the Queries in MDB1

Thanks

G.Gerard
Nov 16 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Thu, 16 Nov 2006 22:50:01 GMT, "G Gerard" <gg*****@nbnet.nb.ca>
wrote:

I don't know how to do that programmatically, but I do know what
you're doing with the tabledef is very bad. You should not assign
dbHiddenObject, but rather use the bitwise Or operator to set that
bit.

-Tom.
>Hello

I am using MSACCESS 2000

I can hide Tables from appearing in the Database Window with the following
code:

For Each tbldef in MyDB.TableDefs
tbldef.Attributes = dbHiddenObject
Next tbldef

How can I do the same with the Queries, to hide them in the Database Window?

Or how can I prevent someone from importing Queries in MDB1 from MDB2 when
this someone belongs to the same
Work Group as MDB1and has Open/Run permission on MDB1.?

By hiding the Tables in MDB1 it looks as if importing through the import
wizards (under File in MSACCESS) is impossible
and I would like this to also be the case for the Queries in MDB1

Thanks

G.Gerard
Nov 17 '06 #2

P: n/a
On Thu, 16 Nov 2006 22:50:01 GMT, "G Gerard" <gg*****@nbnet.nb.cawrote:
>Hello

I am using MSACCESS 2000

I can hide Tables from appearing in the Database Window with the following
code:

For Each tbldef in MyDB.TableDefs
tbldef.Attributes = dbHiddenObject
Next tbldef

How can I do the same with the Queries, to hide them in the Database Window?

Or how can I prevent someone from importing Queries in MDB1 from MDB2 when
this someone belongs to the same
Work Group as MDB1and has Open/Run permission on MDB1.?

By hiding the Tables in MDB1 it looks as if importing through the import
wizards (under File in MSACCESS) is impossible
and I would like this to also be the case for the Queries in MDB1

Thanks

G.Gerard
I would strongly advise against using the above code. There was a known bug in
A97 whereby tables hidden with this code would be deleted during a compact.
http://www.mvps.org/access/bugs/bugs0036.htm

I don't know if this bug has been fixed, but I wouldn't do it anyway.

If you name your queries so that the first 4 characters are "USys"
eg USys_qMyQuery
The query will be treated as a system object (like the MSys tables) and will be
hidden from view unless View System Objects is ticked in Options.

Wayne Gillespie
Gosford NSW Australia
Nov 17 '06 #3

P: n/a
"G Gerard" <gg*****@nbnet.nb.cawrote in message
<tW*******************@ursa-nb00s0.nbnet.nb.ca>:
Hello

I am using MSACCESS 2000

I can hide Tables from appearing in the Database Window with the
following code:

For Each tbldef in MyDB.TableDefs
tbldef.Attributes = dbHiddenObject
Next tbldef

How can I do the same with the Queries, to hide them in the Database
Window?

Or how can I prevent someone from importing Queries in MDB1 from MDB2
when this someone belongs to the same
Work Group as MDB1and has Open/Run permission on MDB1.?

By hiding the Tables in MDB1 it looks as if importing through the
import wizards (under File in MSACCESS) is impossible
and I would like this to also be the case for the Queries in MDB1

Thanks

G.Gerard
As others have stated, be careful with the dbHiddenObject! Another
option, which I don't think has the same disadvantages, is using
the newer (available from the 2000 version, I think)

Application.SetHiddenAttribute <objecttype>, <objectname>, <boolean>

i e

Application.SetHiddenAttribute acQuery, "qryMyQuery", True

--
Roy-Vidar
Nov 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.