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!!!!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Why are you doing this?

Why not just hide the database window?
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top