Turn off controlbox

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?
 
D

Douglas J Steele

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
 
B

Bob Miller

In design view, select Properties from the toolbar, find Control Box and
type in No.
Make sure you have a way to close the form (close button on form)
before you do this.
 
Top