Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hiding Objects in DB Window

48 views
Skip to first unread message

Mark and Meredith Wexler

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
How do I hide objects in code.  The following code will hide only TableDefs!
I also want to iterate through the other containers and hide all objects but can't seem to find any property that would do this.

I want to be able to hide an object without having to right-click and check off the 'hidden' check box.
 

Private Sub cmdHideObjects_Click()
Dim db As Database
Dim var As Variant

Set db = CurrentDb()
For var in db.TableDefs
    lst_itm.Attributes = dbHiddenObject
Next

MsgBox "Complete"

End Sub
 

Please help and TIA,

Mark Wexler, MCP
M&M Business Services, Portland, OR
mm...@europa.com

Michael (michka) Kaplan

unread,
Jan 17, 2000, 3:00:00 AM1/17/00
to
DO NOT USE THIS CODE.

You may find your tables DELETED for your troubles. Leave dbHiddenObject to
the professionals.

There is no programmatic way to change the "hidden" setting for the Access
db window.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?
"Mark and Meredith Wexler" <mm...@europa.com> wrote in message
news:3883BE86...@europa.com...

Mark and Meredith Wexler

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
FIRST: You imply that I am not a professional AND that I don't know what I am
doing!

SECOND: There is a very simple property that will allow you to hide the Access
DB Window in code. Look for the application object in the help. Besides, this
was not the problem presented!

THIRD: The dbHiddenObject is very useful as it will hide the objects and not
even show them when Tools -- Options -- Show Hidden Objects is checked. If you
do wish to see these with this option use the dbSystemObject instead.
Possibly, if you knew more about this property, you may have discovered that
YOUR tables were not deleted, rather hidden as the property name explicitly
states

I would very much like your help, but please DO NOT INSULT ME and please check
the problem before responding. It helps me to get through this stuff quickly
at 1:15 in the morning.

Thank you and have a nice day,


Mark Wexler, MCP
M&M Business Services

mm...@europa.com

Dev Ashish

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to

Arvin Meyer

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to

Mark and Meredith Wexler wrote in message <38842FBB...@europa.com>...

>FIRST: You imply that I am not a professional AND that I don't know what I
am
>doing!

I saw no implication that you weren't a professional, but it is apparent
that you are ill-advised about dbHiddenObject which does have a bug.

>SECOND: There is a very simple property that will allow you to hide the
Access
>DB Window in code. Look for the application object in the help. Besides,
this
>was not the problem presented!

I agree with the not the problem presented part.

>THIRD: The dbHiddenObject is very useful as it will hide the objects and
not
>even show them when Tools -- Options -- Show Hidden Objects is checked. If
you
>do wish to see these with this option use the dbSystemObject instead.
>Possibly, if you knew more about this property, you may have discovered
that
>YOUR tables were not deleted, rather hidden as the property name explicitly
>states

dbHiddenObject may actually DELETE YOUR TABLES during a compact. If you
argue for using it, you should be insulted.

>I would very much like your help, but please DO NOT INSULT ME and please
check
>the problem before responding. It helps me to get through this stuff
quickly
>at 1:15 in the morning.

---
Arvin Meyer

Lyle Fairfield

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
I created db1.

I imported 3 tables, viz,
tbl2000
tbl2000Foods
tblFoods

I closed db1 and checked its size: 1498 kb.

I reopened db1.

I ran this code:

Sub temp1()
Dim tdf As TableDef
For Each tdf In DBEngine(0)(0).TableDefs
If Left(tdf.Name, 3) = "tbl" Then
tdf.Attributes = tdf.Attributes Or dbHiddenObject
End If
Next tdf
End Sub

I looked in the database window. None of the three tables was visible.

I compacted db1.

I ran this code.

Sub temp2()
Dim tdf As TableDef
For Each tdf In DBEngine(0)(0).TableDefs
If Left(tdf.Name, 3) = "tbl" Then
tdf.Attributes = tdf.Attributes And Not dbHiddenObject
End If
Next tdf
End Sub

I looked in the database window.

Only tbl2000 was visible.

I closed db1 and checked its size: 98 kb.

I said to myself, "I think Michka and Arvin are right; I'd better not use
this on any resident tables. The KB does have an article about using it on
linked tables, which I suppose may be OK, as we are unlikely to delete them
physically in compacting; but for resident tables, Uh Uh."

I did a little more experimenting. I found that setting the Hidden property
in the Access UI does not set the dbHiddenObject flag up; this did not
surprise me as "db" implies a Jet property, not an Access property.

Now, I'm turning my attention to (groan) ASP.

--
Lyle
http://www.cyriv.com/


"Arvin Meyer" <a...@m.com> wrote in message
news:861jnt$str$1...@nntp9.atl.mindspring.net...

Pete B

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
You may be "professional" but certainly not knowledgeable in this
particular area. I don't speak for Michael, but I believe in that regard
he was referring to the use of the property, not to your personal worth.

And when it comes to things like this, he is almost invariably offering
advice you had best follow. If he says do not use the dbHiddenObject
attribute, I for one would shun it like the plague....

(Although I have been known to argue about it with him from time to time,
myself :=) )

--
Pete B


Mark and Meredith Wexler <mm...@europa.com> wrote in message

news:38842FBB...@europa.com...


> FIRST: You imply that I am not a professional AND that I don't know what
I am
> doing!
>

> SECOND: There is a very simple property that will allow you to hide the
Access
> DB Window in code. Look for the application object in the help.
Besides, this
> was not the problem presented!
>

> THIRD: The dbHiddenObject is very useful as it will hide the objects and
not
> even show them when Tools -- Options -- Show Hidden Objects is checked.
If you
> do wish to see these with this option use the dbSystemObject instead.
> Possibly, if you knew more about this property, you may have discovered
that
> YOUR tables were not deleted, rather hidden as the property name
explicitly
> states
>

> I would very much like your help, but please DO NOT INSULT ME and please
check
> the problem before responding. It helps me to get through this stuff
quickly
> at 1:15 in the morning.
>

Mark and Meredith Wexler

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to

Thank you all for your input and my public apology to Michael.

 

 

Thank you and I have switched the code to use the dbsystemobject.

In Access 97 --
2 questions -- first, this works with the tabledefs, what about the other container documents
second, does the bug also drop linked tables from SQL Server

--Mark Wexler

Terry Kreft

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
First the code is duff as you should Or the attribute with existing table
attributes

Second if Michael says it's bad then as far as I'm concerned it's almost
certainly bad. Try looking a little further in the thread for a test which
Lyle Fairfield carried out which confirms this viewpoint (and his code was
correct). (BTW Tested, tried same result).

Third there is no way to hide objects in the db window without using the UI,
although you can test to see if they are hidden.

Mark and Meredith Wexler <mm...@europa.com> wrote in message

> Mark Wexler, MCP
> M&M Business Services

> mm...@europa.com

Michael (michka) Kaplan

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
No apology required.

In any case, stay away from THIS code too. Stay away from using DAO to hide
objects in the Access UI.

You must either use the manual method (right clikck/properties) in Access
95/97/2000, or the programmatic method in Access 2000. This is not a case
where a shortcut is going to cause your app anything but grief in the end.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?
"Mark and Meredith Wexler" <mm...@europa.com> wrote in message

news:3884A221...@europa.com...


> Thank you all for your input and my public apology to Michael.
>
>
>
>
>
> Thank you and I have switched the code to use the dbsystemobject.
>
> In Access 97 --
> 2 questions -- first, this works with the tabledefs, what about the other
> container documents
> second, does the bug also drop linked tables from SQL Server
>
> --Mark Wexler
>
>
>

Michael (michka) Kaplan

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
Please see the other responses on this thread.

You are wrong, and are giving bad advice. And others who follow it and find
their tables deleted will certainly blame you, not I.

No insult or slur on your professionalism was implied or intended (again,
see another post, such as Arvin's, which point out they saw no such thing).
You can be a professional and be wrong. Such is the case here.

So, Mark, please take the criticism of the flawed code technique for what it
is, and nothing more.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?
"Mark and Meredith Wexler" <mm...@europa.com> wrote in message

> Mark Wexler, MCP
> M&M Business Services

> mm...@europa.com

Pedro Gil

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
By the way please drop the HTML posting.

pmpg

Michael (michka) Kaplan

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
It can't be done. There is no way to programatically hide objects in the DBC
in Access < 2000.

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?
"Chuck Grimsby" <cdotg...@worldnetdotattdot.net> wrote in message
news:ig2a8scflmbc1ggb4...@4ax.com...
>
> I wonder how (and if) this could be done through code somehow....
>
> MyTable.Properties.Hidden = True
>
> or something like that. I suppose you'd have to create the property
> as well though....
>
> MichKa? Is this safe?


>
> On Tue, 18 Jan 2000 12:26:23 GMT, "Lyle Fairfield"
> <LyleFa...@CyRiv.Com> wrote:
>
> >I did a little more experimenting. I found that setting the Hidden
property
> >in the Access UI does not set the dbHiddenObject flag up; this did not
> >surprise me as "db" implies a Jet property, not an Access property.
>

> ------
> Ensign Pencil? He's Lead, Jim.

Allen Browne

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
There is a simple, safe way to hide the odd table,
that I haven't seen mentioned here for some time.

Use a table name starting with "USys".


Mark and Meredith Wexler wrote:
>
> How do I hide objects ...

--
Perth, Western Australia
Tips for MS Access users at:
http://www.wa.apana.org.au/~abrowne/

Pete B

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
Why would you _want_ to do that, since you have other security and
startup/run options you can use that will completely eliminate any
possibility of a user ever seeing that window in the first place? IOW, if
someone can get to the db design window to begin with, either you have not
properly secured the app, or else they have a right (the necessary security
permits) to be there and thus see everything there.

So why worry about it? If it cannot be done, it is of no consequence.

--
Pete B
Michael (michka) Kaplan <forme...@spamless.trigeminal.spamless.com> wrote
in message news:OfStsijY$GA.146@cpmsnbbsa03...

Brett J. Valjalo

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
Hmmm. Interesting logical question, from a syllogistic viewpoint. Since Logic
was about the only A grade I got in college...

Given: Only professionals should use the dbHiddenObject Function
This would seem to imply that the entire class of professionals consists of
those who are qualified to use said function, i.e, they are one and the same.

Given: You Should not use the dbHiddenObjectFunction
As the verbage of "Leave the <function>. to the professionals" would reasonably
be viewed:

Therefore, you are outside of the class of those who should use said function,
which is equivalent to those who are professionals.

My analysis is that you in fact argued that he was not a professional, IF you
told him that he's not qualified to use said function without stipulating that
there is a separate subclass of professionals who aren't qualified to use the
function. Which you did not stipulate one way or the other. So what does that
really amount to? Perhaps you should tell him that there is such a separate
subclass, lest he be offended...

Not that I really care, I just felt like doing the logic exercise...

brett

"Michael (michka) Kaplan" wrote:

> Please see the other responses on this thread.
>
> You are wrong, and are giving bad advice. And others who follow it and find
> their tables deleted will certainly blame you, not I.
>
> No insult or slur on your professionalism was implied or intended (again,
> see another post, such as Arvin's, which point out they saw no such thing).
> You can be a professional and be wrong. Such is the case here.
>
> So, Mark, please take the criticism of the flawed code technique for what it
> is, and nothing more.
>

> --
> ?MichKa
> (insensitive fruitarian)
>
> random junk of dubious value, a multilingual website, the
> 48-language TSI Form/Report to Data Access Page Wizard,
> and lots of replication "stuff" at http://www.trigeminal.com/
>
> ?

> > > --
> > > ?MichKa
> > > (insensitive fruitarian)
> > >
> > > random junk of dubious value, a multilingual website, the
> > > 48-language TSI Form/Report to Data Access Page Wizard,
> > > and lots of replication "stuff" at http://www.trigeminal.com/
> > >
> > > ?

> > > "Mark and Meredith Wexler" <mm...@europa.com> wrote in message
> > > news:3883BE86...@europa.com...
> > > > How do I hide objects in code. The following code will hide only
> > > > TableDefs!
> > > > I also want to iterate through the other containers and hide all
> objects
> > > > but can't seem to find any property that would do this.
> > > >
> > > > I want to be able to hide an object without having to right-click and
> > > > check off the 'hidden' check box.
> > > >
> > > >
> > > > Private Sub cmdHideObjects_Click()
> > > > Dim db As Database
> > > > Dim var As Variant
> > > >
> > > > Set db = CurrentDb()
> > > > For var in db.TableDefs
> > > > lst_itm.Attributes = dbHiddenObject
> > > > Next
> > > >
> > > > MsgBox "Complete"
> > > >
> > > > End Sub
> > > >
> > > >
> > > > Please help and TIA,
> > > >
> > > > Mark Wexler, MCP
> > > > M&M Business Services, Portland, OR
> > > > mm...@europa.com
> > > >
> >

--
Brett Valjalo * Assistant to the President
Corporate Alliances * Career Agents
300 Brannan Street * Suite 212 San Francisco, Ca 94107
Work/415-597-5509 Fax/415-597-5501 PCS/510-331-5555
Email/br...@careeragents.com
http://www.careeragents.com

Dev Ashish

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to

"Brett J. Valjalo" <br...@careeragents.com> wrote in message
news:38860A72...@careeragents.com...

:
: Not that I really care, I just felt like doing the logic exercise...
:

And VBA bores you???

-- Dev

Michael (michka) Kaplan

unread,
Jan 19, 2000, 3:00:00 AM1/19/00
to
I was actually referring to the professionals who handle system tables as
part of their job (i.e., the Jet team), you wingnut!
--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?


"Brett J. Valjalo" <br...@careeragents.com> wrote in message
news:38860A72...@careeragents.com...

> Not that I really care, I just felt like doing the logic exercise...
>

Brett J. Valjalo

unread,
Jan 20, 2000, 3:00:00 AM1/20/00
to
See, that's what I was talking about! ;)

Brett J. Valjalo

unread,
Jan 20, 2000, 3:00:00 AM1/20/00
to
Well, Dev, of course. As everyone around here can see, I've got it
mastered. So it's probably time to move on to that VBA project that does
both Air Traffic Control and Brain Surgery that I was brushing up my
skills to do...
;)
brett

Dev Ashish wrote:

> "Brett J. Valjalo" <br...@careeragents.com> wrote in message
> news:38860A72...@careeragents.com...
>

> :
> : Not that I really care, I just felt like doing the logic exercise...
> :
>
> And VBA bores you???
>
> -- Dev

--

Michael (michka) Kaplan

unread,
Jan 20, 2000, 3:00:00 AM1/20/00
to
(cancels his flight plans and thanks the heavens that he has no brain that
would need surgery)

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the
48-language TSI Form/Report to Data Access Page Wizard,
and lots of replication "stuff" at http://www.trigeminal.com/


?


"Brett J. Valjalo" <br...@careeragents.com> wrote in message

news:38877EA3...@careeragents.com...

Brett J. Valjalo

unread,
Jan 21, 2000, 3:00:00 AM1/21/00
to
Probably a wise idea...

Dev Ashish

unread,
Jan 21, 2000, 3:00:00 AM1/21/00
to
Sheesh!!!

Brett J. Valjalo

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
Dev:
As you can see, Michael is long past appreciating my critiques of his
logic. He's fun to bug, though, 'cause you can always get a rise out of
him !
brett

Dev Ashish wrote:

> Sheesh!!!

Michael (michka) Kaplan

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
Actually, now that I know its what you are after, I think you will just stay
in the killfile permanently. In the future (with the next person you delight
in annoying), think before you speak. Life is too short to waste time with
the likes of you "getting a rise out of me."

<PLONK>

--
?MichKa
(insensitive fruitarian)

random junk of dubious value, a multilingual website, the

54-language TSI Form/Report to Data Access Page Wizard,


and lots of replication "stuff" at http://www.trigeminal.com/


?
"Brett J. Valjalo" <br...@careeragents.com> wrote in message

news:388C9BBE...@careeragents.com...

0 new messages