VBA code to hide all the tables on form open

S

Song Su

I don't want people to use a blank mdb to import my tables. I manually hide
them all. However, after running the macro to delete all records and import
from .txt, the table become unhide. I do the importation on daily basis.

I posted to macro newsgroup and asked way to hide table after importation
action macro but got no answer. Maybe it cannot be done in macro?

If so, I need VBA code to hide all the tables on form open. Thanks.
 
D

Douglas J. Steele

Hiding your tables won't prevent people from being able to import them into
a blank mdb. All they have to do is ensure that they've set the database to
show hidden objects.
 
S

Song Su

I disabled shift bypass key. It's additional layer of security if I can hide
tables in code. Thanks.
 
D

Douglas J. Steele

Disabling the shift bypass key has nothing to do with whether or not it's
possible to import the tables into another mdb.

I'm afraid you're fooling yourself if you think you're providing any
security against that.
 
S

Song Su

I just tried. hide all the tables, and disable shift key. Using a blank mdb
to import from that mdb which contains tables. All I see is the blank (no
tables).

Unless people know how to enable shift key (which 99% in my workplace
don't), then they can unhide tables.
 
D

Douglas J. Steele

While you're in the blank database, go to the View tab under Tools | Options
and check that you want to see hidden objects. Now when you go to File | Get
External Data, you'll see all of the tables in your other database.

Heck, unless you've done something to prevent them from seeing the database
window in your database, they'll be able to see the tables there too once
that setting's been made.
 
S

Song Su

While I'm in blank database, I cannot go to View Tab under Tools | Options
as I already disabled Shift bypass key. And under startup, I already
UNchecked "display datasheet window'. As I said earlier, 99% users do not
know how to enable Shift bypass key in my workplace. If they figuered out,
I'll tell the president to fire them.
 
D

Douglas J. Steele

When you create a new database, the ShiftBypassKey is always enabled: you
have to explicitly set that property, so I don't understand your first
point.


In the end, it's obviously your decision, but I think you're being very
short-sighted.
 
S

Song Su

So, in your opinion, what's the best way to prevent people from importing my
backend tables?
 
D

Douglas J. Steele

The only thing you can do is apply Access User-Level Security. However, even
that isn't fool-proof (there are utilities that can be purchased to
circumvent security), plus ULS isn't available in Access 2007.
 

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