用VBA显示或隐藏全部ACCESS对象
时 间:2017-10-30 17:45:24
作 者:Big Young ID:252 城市:襄阳
摘 要:用VBA显示或隐藏全部ACCESS对象
正 文:
'Created by Speakers_86
'You are free to use, modify, and distribute
'this as long as you leave this comment
'
'Purpose: loops through all of you access objects, and
' hides them, the same as using the Access Gui to
' hide an object
'Argument: booHide
' an optional argument. True hides objects,
' false unhides objects
Dim db As Database
Dim tbl As TableDef
Dim qry As QueryDef
Dim str As String
Dim i As Integer
On Error Resume Next
Set db = CurrentDb()
For Each tbl In db.TableDefs
Call SetHiddenAttribute(acTable, tbl.Name, booHide)
Next tbl
For Each qry In db.QueryDefs
Call SetHiddenAttribute(acQuery, qry.Name, booHide)
Next qry
For i = 0 To db.Containers("Forms").Documents.Count - 1
str = db.Containers("Forms").Documents(i).Name
Call SetHiddenAttribute(acForm, str, booHide)
Next
For i = 0 To db.Containers("Reports").Documents.Count - 1
str = db.Containers("Reports").Documents(i).Name
Call SetHiddenAttribute(acReport, str, booHide)
Next i
For i = 0 To db.Containers("Modules").Documents.Count - 1
str = db.Containers("Modules").Documents(i).Name
Call SetHiddenAttribute(acModule, str, booHide)
Next i
For i = 0 To db.Containers("Scripts").Documents.Count - 1
str = db.Containers("Scripts").Documents(i).Name
Call SetHiddenAttribute(acMacro, str, booHide)
Next i
Set db = Nothing
End Sub
Access软件网官方交流QQ群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access窗体导出PDF】...(04.08)
- 【Access窗体导出PDF】...(04.07)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
学习心得
最新文章
- Access日期格式的数据导出Ex...(04.28)
- ACCESS精华集锦资料.CHM(04.25)
- Access VBA语句If Me...(04.24)
- 【Access修改记录示例】编辑选...(04.22)
- 【Access表名称命名建议】将A...(04.20)
- Access学习笔记--用Acce...(04.19)
- 【Access重复项查询示例】将A...(04.17)
- Access快速开发平台企业版--...(04.16)
- 【Access模块示例】通过模块代...(04.15)
- Access查询里面分组合计功能添...(04.13)