Public Sub 显隐当前DB表(tof As Boolean) '显示/隐藏当前数据库的表或查询(true隐藏\false显示)
Dim dbs As Database
Set dbs = CurrentDb
Dim tf As TableDef
Dim qf As QueryDef
For Each tf In dbs.TableDefs
If Left(tf.Name, 2) <> "ms" And Left(tf.Name, 1) <> "~" Then
Application.SetHiddenAttribute acTable, tf.Name, tof
End If
Next
For Each qf In dbs.QueryDefs
If Left(qf.Name, 1) <> "~" Then
Application.SetHiddenAttribute acQuery, qf.Name, tof
End If
Next
End Sub