changing access properties...do i have to do it one by one?

berbes

New Member
Joined
Dec 9, 2004
Messages
31
hello...i'm in the process of changing 1000's of access tables, queries, forms, reports, and macros properties to hidden. i am currently right clicking a file, choosing 'hidden', and moving on to the next.

isn't there a way to highlight multiple tables (or whatever) like you can in windows explorer and then right clicking to change properties to change many at once, or am i constrained to doing this one by one?

thanks again, guys!!!!
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,912
Office Version
  1. 365
Platform
  1. Windows
Why are you doing this?

Why not just hide the database window?
 

berbes

New Member
Joined
Dec 9, 2004
Messages
31
hiya norrie-

thanks for answering...i've read and learned a bunch from your replies. to answer your q, i'm temping in a large insurance underwriter, and i'm sure it has to do with an additional layer of security due to the multiple network drives, plus a million other reasons i could never come up with. i am just looking for a way to save many hours where i could be doing something better with my time. it seems so pointless to do each file's properties one by one, but there you go, right? nothing quite like corporate america, huh?

am i as screwed as i think i am, or is there an easier way to do this?
 

Philem

Active Member
Joined
Jan 2, 2003
Messages
282
Read the Helpfile on the SetHiddenAttribute method. This allows you to do what you want. Just loop through the objects in your db, and call this method as appropriate.

HTH (y)
-P
 

giacomo

Well-known Member
Joined
Feb 20, 2002
Messages
1,796

ADVERTISEMENT

Code:
Sub HideEverything()
Dim obj As Object
Dim boolHidden As Boolean

'Change boolHidden to False to show all
boolHidden = True

For Each obj In CurrentDb.TableDefs
     If Not obj.Name Like "Msys*" Then
     Application.SetHiddenAttribute acTable, obj.Name, boolHidden
     End If
Next obj

For Each obj In CurrentDb.QueryDefs
     If Not obj.Name Like "~*" Then
     Application.SetHiddenAttribute acQuery, obj.Name, boolHidden
     End If
Next obj

For Each obj In CurrentProject.AllForms
     Application.SetHiddenAttribute acForm, obj.Name, boolHidden
Next obj

For Each obj In CurrentProject.AllReports
     Application.SetHiddenAttribute acReport, obj.Name, boolHidden
Next obj

For Each obj In CurrentProject.AllMacros
     Application.SetHiddenAttribute acMacro, obj.Name, boolHidden
Next obj

End Sub

hth,
Giacomo
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi

You may want to add the following lines to giacomo's code to hide the modules (if any) :

Code:
For Each obj In CurrentProject.AllModules
    Application.SetHiddenAttribute acModule, obj.Name, boolHidden
Next obj

Also keep in mind that if the user opens the database with the ability to see hidden objects, this defeats hiding the objects using the 'hidden' property. The way to prevent this is to include the following lines of code in any code you activate when the database first opens :

Code:
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show System Objects", False

Any such startup routines can be over-ridden by holding down the shift key when opening the database but that's another story....

HTH, Andrew
 

Watch MrExcel Video

Forum statistics

Threads
1,113,811
Messages
5,544,451
Members
410,612
Latest member
MrACED
Top