P
Paul Ponzelli
I'm trying to use the code below to set the Modal property of all forms in
an Access 2002 database to "No."
The code compiles, and runs completely through both loops, and the
Debug.Print frm.Modal command confirms that as the code is running, the
Modal properties are being set to "No." But the line that tries to save the
form after the modal property has been set to "No",
DoCmd.Save acForm, strFormName
doesn't seem to have any effect, because when you open the form after the
procedure runs, the modal property is still set to "Yes" (if it had been set
to "Yes" before you run the procedure.
Here's that line in context:
For Each frmDoc In db.Containers("Forms").Documents
strFormName = frmDoc.Name
DoCmd.OpenForm strFormName
For Each frm In Forms
frm.Modal = False
Debug.Print frm.Name
Debug.Print frm.Modal
DoCmd.Save acForm, strFormName '<-- this line doesn't save
the new Modal property.
DoCmd.Close acForm, strFormName
Next frm
Next frmDoc
How can I modify that single line of code to save the new property setting
when it closes the forms?
Thanks in advance,
Paul
an Access 2002 database to "No."
The code compiles, and runs completely through both loops, and the
Debug.Print frm.Modal command confirms that as the code is running, the
Modal properties are being set to "No." But the line that tries to save the
form after the modal property has been set to "No",
DoCmd.Save acForm, strFormName
doesn't seem to have any effect, because when you open the form after the
procedure runs, the modal property is still set to "Yes" (if it had been set
to "Yes" before you run the procedure.
Here's that line in context:
For Each frmDoc In db.Containers("Forms").Documents
strFormName = frmDoc.Name
DoCmd.OpenForm strFormName
For Each frm In Forms
frm.Modal = False
Debug.Print frm.Name
Debug.Print frm.Modal
DoCmd.Save acForm, strFormName '<-- this line doesn't save
the new Modal property.
DoCmd.Close acForm, strFormName
Next frm
Next frmDoc
How can I modify that single line of code to save the new property setting
when it closes the forms?
Thanks in advance,
Paul