Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide table (Access 2000)

    I know how to hide objects. However, how do you run a make table query and hide the table being created? Thank you.

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Hide table (Access 2000)

    If you are trying to hide the table, why not just use a query? You can then use the query as a datasource for other items.
    Regards,

    Gary
    (It's been a while!)

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide table (Access 2000)

    Gary's comments apart, you can use code to make the table hidden after is has been created:

    Application.SetHiddenAttribute acTable, "tblJustCreated", True

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide table (Access 2000)

    Hans

    Is Application.SetHiddenAttribute acTable, "tblJustCreated", False

    the only way to see the table again?

    John

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hide table (Access 2000)

    That is the only way to unhide the table in code, AFAIK. But if you tick "Hidden Objects" in the View tab of Tools | Options..., you can see the table, slightly greyed, in the database window. You can remove the hidden attribute by right-clicking the table, selecting Properties and clearing the "Hidden" check box.

  6. #6
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Hide table (Access 2000)

    Another way to hide a table is to set the TableDef's dbHiddenObject attribute. When this flag is set, the table will not be visible in the database window, even if the Show Hidden Objects option is checked in the Options dialog (View tab). One slight technicality is that next time you compact the database, the table is deleted - the dbHiddenObject flag apparently also acts as a flag to delete the object (this is applicable in ACC 97; does not occur in A2K; I don't know about A2002/2003). For more info see these MSKB articles:

    ACC2000: How to Use Visual Basic to Hide a Link to an External Table

    HOW TO: Use the Attributes Property for TableDef Objects in Access 2000

    It is interesting to note, even the ACC 97 versions of these MSKB articles did not mention the minor "technicality" noted above, though did note in description of the available attribute flags:

    DbHiddenObject
    Indicates the table is a hidden table (for temporary use).

    (Emphasis added.) This tends to imply the setting is not intended for "permanent" tables. Also be advised, if table hidden using this method, it will not appear in the Show Table dialog (Query design) & other dialogs, which may not be very convenient. For more info, see these previous threads on the subject:

    <!post=Post 13951 - Re: Hide tables programmatically,13951>Post 13951 - Re: Hide tables programmatically<!/post>

    <!post=Post 125507 - Re: Hid a table (2k or 97),125507>Post 125507 - Re: Hid a table (2k or 97)<!/post>

    In these threads, Charlotte warned of the possible consequences when setting this attribute. So if "experimenting" with this, recommend do so only with a BACKUP copy of database. And always test for attribute flag (using AND as bitwise operator) before setting attribute to avoid "surprises" or unexpected behavior. The real issue is, don't hide table, hide the database window, using Startup options, security settings, etc. That is the only reliable method for preventing end-users from meddling with tables & other database objects.

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •