Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 22nd, 2005, 06:49 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #2 (permalink)  
Old June 23rd, 2005, 01:54 PM
Authorized User
 
Join Date: Jun 2005
Location: , , .
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.


Reply With Quote
  #3 (permalink)  
Old June 23rd, 2005, 02:26 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #4 (permalink)  
Old June 23rd, 2005, 04:58 PM
Authorized User
 
Join Date: Jun 2005
Location: , , .
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



Reply With Quote
  #5 (permalink)  
Old June 24th, 2005, 06:12 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

That's EXACTLY what I needed Developer1861!

You totally Wrox!

Thanks,


mmcdonal
Reply With Quote
  #6 (permalink)  
Old June 24th, 2005, 10:13 AM
Authorized User
 
Join Date: Jun 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

de nada

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.