Setting properties of all forms in DB in code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working with Access 2003 and I want to set the Allow Edits, Allow
Deletions and Allow Additions of all the forms in my DB to No. Is there a way
to cycle through all the forms in code and set these properties? There are
about 100 of them.

Thanks,
Clint
 
Try this
Public Sub ChangeAllign()
Dim i As Integer, frmName As String
For i = 0 To CurrentDb.Containers("forms").Documents.Count
frmName = CurrentDb.Containers("forms").Documents(i).Name
DoCmd.OpenForm frmName, acDesign
Forms(frmName).AllowAdditions = False
Forms(frmName).AllowDeletions = False
Forms(frmName).AllowEdits = False
DoCmd.Close acForm, frmName, acSaveYes
Next i
End Sub
 
Back
Top