查询:
SELECT Name FROM MsysObjects WHERE Left$([Name],1)<>"~" AND Type=5 ;
窗体:
SELECT Name FROM MsysObjects WHERE (Left$([Name],1)<>"~" AND Type=-32768;
表:
SELECT Name FROM MsysObjects WHERE Left$([Name],1)<>"~" AND Left$([Name],4) <> "Msys") AND Type=1;
报表:
SELECT Name FROM MsysObjects WHERE Left$([Name],1)<>"~" AND Type= -32764 ;
模块:
SELECT Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND (MSysObjects.Type)= -32761;
宏:
SELECT Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND (MSysObjects.Type)= -32766;
Sub AllForms()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
For Each obj In dbs.AllForms
Debug.Print obj.Name
Next obj
End Sub