Bom dia
'Autor JPaulo
Public Function EscondeTudo(Status As Boolean)
Dim obj As AccessObject
Dim dbs As Object
Dim T As DAO.TableDef
Dim tblNome As String
Dim I As Integer
Dim X As Integer
Dim DB As DAO.Database
Application.SetOption "Show Hidden Objects", False 'marca a checkbox de ocultar objectos nas opções do Access
Set DB = CurrentDb() 'para o access 2007
Set dbs = Application.CurrentProject
'oculta os forms
For Each obj In dbs.AllForms
Application.SetHiddenAttribute acForm, obj.Name, Status
Next obj
'oculta os relatorios
For Each obj In dbs.AllReports
Application.SetHiddenAttribute acReport, obj.Name, Status
Next obj
'oculta os modulos
For Each obj In dbs.AllModules
Application.SetHiddenAttribute acModule, obj.Name, Status
Next obj
'oculta as macros
For Each obj In dbs.AllMacros
Application.SetHiddenAttribute acMacro, obj.Name, Status
Next obj
'oculta as consultas
Set dbs = Application.CurrentData
For Each obj In dbs.AllQueries
Application.SetHiddenAttribute acQuery, obj.Name, Status
Next obj
'oculta as tabelas
For I = 0 To DB.TableDefs.Count - 1
Set T = DB.TableDefs(I)
tblNome = T.Name
If Not tblNome Like "msys*" Then
Application.SetHiddenAttribute acTable, tblNome, Status
X = X + 1
End If
Next I
End Function
--------------------------------------
Num comando dum botão ao fazer Click
Call EscondeTudo(True) 'o True oculta tudo
------------------------
Outro botão
Call EscondeTudo(False)