Turn off controlbox

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have finished a database and I would like to remove the control box from
all forms. Is there an easy way to do this or do I have to go into every
form and disable it?
 
The following untested aircode will loop through all of the forms in the
database, setting the ControlBox property to whatever value is passed to the
routine:

Sub SetControlBox(SetTo As Boolean)

Dim dbCurr As DAO.Database
Dim ctrForms As DAO.Container
Dim docForm As DAO.Document

Set dbCurr = CurrentDb()
Set ctrForms = dbCurr.Containers("Forms")
For Each docForm In ctrForms.Documents
DoCmd.OpenForm docForm.Name, acDesign, , , , acHidden
Forms(docForm.Name).ControlBox = SetTo
DoCmd.Close acForm, docForm.Name, acSaveYes
Next docForm

End Sub
 
Back
Top