Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default Hide table with VBA

Hi again,

   As part of an application I am building, I want to hide all the tables, queries, forms, etc from the users. They are not sophisticated enough to know how to unhide them. Hiding them using the Properties dialog box works fine.

   However, one of the things the database does is, since it is OLAP only for these users, it deletes two existing tables On Open, and then takes new copies of the tables from a back end that is maintained with an administrative interface.

   This is the code I am using to copy the tables after the old ones are deleted:

'----------
DoCmd.TransferDatabase acImport, "Microsoft Access", _
        "I:\NFC_Data\Interfaces\AOC_WPM_POV_Authorized_be. mdb", acTable, "tblOrgCode", "tblOrgCode"
    DoCmd.TransferDatabase acImport, "Microsoft Access", _
        "I:\NFC_Data\Interfaces\AOC_WPM_POV_Authorized_be. mdb", acTable, "tblAuthorized", "tblAuthorized"
'----------

   I would like to add code to hide these tables once they are copied. I can hide them manually, but once they are deleted and a new version is brought over, they are not hidden since that attribute is not set in the transfer command.

Thanks in advance,


mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old June 23rd, 2005, 01:54 PM
Authorized User
 
Join Date: Jun 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did u know that u can hide the entire database window from the end user by going to tools->startup, and then unchecking the "Display Database window" checkbox?

This means that only your startup form, if you have one, (and any subsequent forms, reports, etc, brought up programatically) will appear when you open the database. The user will NOT see any other tables, queries, forms, etc.

if you want to see the database window (which would come in hand when you want to modify anything)then simply press the shift key down when bringing up the mdb.


 
Old June 23rd, 2005, 02:26 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Thanks for your reply. I did hide the database window, but I think some of my users are sophisticated enough to know about the shift key, and also about f11 once in the database, to unhide the database window.

Once the database window is shown, there appear to be no objects in the database except the three tables transferred during the on open event of the main form. I want all objects to be hidden once the database window is shown.

I don't think my users are sophisticated enough to know how to unhide hidden and system objects once they have the window open, or that there would even be any hidden objects. They might think it is all code... which is why I am making an mde, to prevent them from seeing the path to the data.

Any other ideas?

Thanks again,


mmcdonal
 
Old June 23rd, 2005, 04:58 PM
Authorized User
 
Join Date: Jun 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Alright, i think this is pretty simple:

Application.SetHiddenAttribute acTable, "MyTable", True ' will hide the table "MyTable"

Application.SetHiddenAttribute acTable, "MyTable", False ' will unhide the table "MyTable"

Let me know if that is helpful



 
Old June 24th, 2005, 06:12 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

That's EXACTLY what I needed Developer1861!

You totally Wrox!

Thanks,


mmcdonal
 
Old June 24th, 2005, 10:13 AM
Authorized User
 
Join Date: Jun 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

de nada






Similar Threads
Thread Thread Starter Forum Replies Last Post
hide certain column in a table lscjtw XSLT 2 August 2nd, 2007 01:26 PM
How to hide VBA code james gold Excel VBA 12 November 14th, 2005 10:59 AM
How to hide a table TR oranginalab Javascript How-To 9 January 24th, 2005 04:35 AM
Hide Row with VBA Butch Excel VBA 2 November 24th, 2004 09:11 AM
Hide VBA code when forwarding macro sh333384 Excel VBA 7 September 2nd, 2004 10:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.