|
试试下面的代码
- Dim tabDef As TableDef
- Dim qryDef As QueryDef
- Set tabDef = New TableDef
- Dim strFileName As String
- Set dbs = CurrentDb
- For Each tabDef In dbs.TableDefs
- If tabDef.Name <> "pig_label" And tabDef.Name <> "lot" And tabDef.Name <> "mb_iso" And tabDef.Name <> "label" And tabDef.Name <> "z1_label" And tabDef.Name <> "system_label" And tabDef.Name <> "comm" And tabDef.Name <> "dow_1" And tabDef.Name <> "sanxin_label" And tabDef.Name <> "nhh" And tabDef.Name <> "sh" And tabDef.Name <> "weisu" And tabDef.Name <> "com(月份)" And tabDef.Name <> "com(total)" And tabDef.Name <> "com_MB(月份)" And tabDef.Name <> "com_mb(total)" Then ' dbHiddenObject '0,4
- tabDef.Attributes = 1
- End If
- Next
- For Each qryDef In CurrentDb.QueryDefs
- If Left(qryDef.Name, 1) <> "~" Then
- Application.SetHiddenAttribute acQuery, qryDef.Name, False
- End If
- Next
- MsgBox "成功地隱藏了該資料庫的所有表"
复制代码 |
|