?
Solved

VBA; SetHiddenAttribute

Posted on 2007-03-28
5
Medium Priority
?
1,102 Views
Last Modified: 2012-08-13
Can I use SetHiddenAttribute to hide access tables by connecting to the access db from a separate db.  That is, I want to write a module in db1 to hide tables in db2.  I can get dbi to list table names from db2 but I can't figure out how to set the attributes.
0
Comment
Question by:Shelnutt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 85
ID: 18809386
I believe SetHiddenAttribute only works with the current database. YOu can open the remote database and set the attribute like this:

  Dim db As DAO.Database
  Dim td As DAO.TableDef

  Set db = DAO.OpenDatabase("Full path to db")

  Set td = db.TableDefs("NameOFTable")
  td.Attributes = td.Attributes AND dbHiddenObject

  Set td = Nothing
  Set db = Nothing
0
 

Author Comment

by:Shelnutt
ID: 18810448
LSM,
Thank you for the quick response.  I have tried the code you provided and it appears to run, but when I open the target db, the tables are still "not" hidden.  What might I be doing wrong?  Any guesses?
0
 

Accepted Solution

by:
flyinghigh earned 200 total points
ID: 19123942
SetHiddenAttribute also works with remote database. You can hide tables, queries, ....
To hide a table try this:

Dim appAcc As Access.Application
Set appAcc = New Access.Application
 
appAcc.OpenCurrentDatabase "Full path to db"
appAcc.Application.SetHiddenAttribute acTable, "NameOfTable", True
 
appAcc.Quit
Set appAcc = Nothing
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21177270
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question