Public Sub AllFrormsRecordType()
Dim obj As AccessObject, dbs As Object
Dim k%
k = 0
Set dbs = Application.CurrentProject
For Each obj In dbs.AllForms
k = k + 1
Debug.Print k, obj.Name
DoCmd.OpenForm obj.Name, acViewDesign, , , acHidden
With Forms(obj.Name)
On Error Resume Next
Forms(obj.Name).RecordsetType = 0 '2 - для запрета редактирования
DoCmd.Close acForm, obj.Name, acSaveYes
End With
Next obj
MsgBox Now(), , "Всего форм в базе " & k
End Sub
|