Hide / Unhide All forms - reports - Modules

editolis

Panathinaikos Fun
Local time
Today, 22:50
Joined
Oct 17, 2008
Messages
107
Hi all,

Can someone show me how
we can hide / unhide with a command button: all forms,
reports and modules from a database?

Thank you in advance.
 
how do you mean, hide?

can you not just set the startup properties to hide the database window? Is this simple enough, or are your users starting to investigate stuff.

You can set certain dbs objects as hidden, but then anyone can set them as unhidden by reversing the process.

so the discussion of exactly what you are trying to do, in terms of protecting various dbs objects becomes far more far-reaching.
 
Dear Dave
There is no any particular reason.
I am just curious to find out.
So do have any suggestion?
 
if you right click an item in the data-base window , you get properties

in the properties there is a check box to set this as hidden. There is then a database option to show/hide hidden objects.

------------
you will be able to get at this property in code by using the relevant property of the correct database container collection - it is cetainly doable, but i haven't ever used this, and it would take some digging out. Perhaps someonme else knows the exact systax
 
Here in this forum i find out how we can hide/unhide the qry's.

Can we do someyhing similar with forms-reports-modules?

The code for the qry's:
======================
Function HideQuerys()
Dim qry As QueryDef
Dim x As Integer

For Each qry In CurrentDb.QueryDefs

If Left(qry.Name, 1) <> "~" Then
If Not Left(qry.Name, 4) = "Usys" Then
qry.Name = "Usys" & qry.Name
End If
End If
Next
End Function
========================
Function UnHideQuerys()
Dim qry As QueryDef
Dim x As Integer

For Each qry In CurrentDb.QueryDefs

If Left(qry.Name, 1) <> "~" Then
If Left(qry.Name, 4) = "Usys" Then
qry.Name = Mid(qry.Name, 5)
End If
End If
Next
End Function
 
usys queries are normally used for special internal queries

however, if you rename your queries, you may find that your forms etc stop working, as the references to these queries may not update.

copy the database, before trying this.
 

Users who are viewing this thread

Back
Top Bottom