Sub Delobjs()
'功能:删除当前数据库中的所有窗体和查询
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
For Each obj In dbs.AllForms
DoCmd.DeleteObject acForm, obj.Name
Next obj
For Each obj In dbs.AllQueries
DoCmd.DeleteObject acQuery, obj.Name
Next obj
End Sub