Hidding MS Access Objects (1 Viewer)

How To Hide Objects

  • How To Set Object Properties

    Votes: 0 0.0%
  • How To Set System Properties

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.
W

WoodsRichard

Guest
I have found this code and it works great for tables. They are Hidden and unless you VBA code to unhide they can not be seen. I need code to hide macros, querys, and modules. I tried to modify this code and can not seem to get it to work.
Public Sub HideTable(ByVal sTableName As String)
Application.CurrentDb.TableDefs(sTableName).Properties("Attributes").Value = dbHiddenObject
End Sub
:confused:
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:28
Joined
Jul 9, 2003
Messages
16,269
I would be very careful!

WoodsRichard said:
I have found this code and it works great for tables. They are Hidden and unless you VBA code to unhide they can not be seen. I need code to hide macros, querys, and modules. I tried to modify this code and can not seem to get it to work.
Public Sub HideTable(ByVal sTableName As String)
Application.CurrentDb.TableDefs(sTableName).Properties("Attributes").Value = dbHiddenObject
End Sub
:confused:

I recalled a problem with this method of hiding tables, and I found an interesting comment here:

http://www.mvps.org/access/bugs/bugs0036.htm

By way of testing:
I have just run the code in an MS Access 2002 database, I ran the compact and repair routine, as far as I can tell none of my tables have disappeared. I did hide a system table, And a linked table, as well, and everything seems OK. I didn't check to see if the linked table and system table were still accessible after it was hidden. I would Advise against using this method. If you do decide to use it I would do some serious research first. Please report your findings back here! I would love to know! Cheers Tony.
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom