Change form properties globally

  • Thread starter Thread starter google3luo359
  • Start date Start date
G

google3luo359

Just curious as to this one (I'm currently changing over a dozen form
property boxes).

For property things like control box, border, caption etc.
Is it possible to globally change various properties in all of your
forms, at once?

TIA Ric
 
It is possible to code to to this.

Assuming Access 2000 or later, use CurrentProject.AllForms to find the form
names. Open them in design view, hidden if you wish. Make the changes. Save.
Close. Loop through the rest of the forms.

This kind of thing:

Function FixAllForms()
Dim accObj As AccessObject
Dim strForm As String
Dim frm As Form

For Each accObj In CurrentProject.AllForms
strForm = accObj.Name
DoCmd.OpenForm strForm, acDesign, WindowMode:=acHidden

Set frm = Forms(strForm)
frm.ControlBox = False
'etc for other properties

Set frm = Nothing
DoCmd.Close acForm, strForm, acSaveYes
Next
End Function
 
Ahhh... that's perfect Allen. Thanks very much. That will be very
helpful as I proceed.

Ric
 
Hi Allen,

Quick question on this technique.
Will it loop through all forms in the project or just the current one
open?
Most times I'd just need to change the properties on the objects in the
current form/subform.

Ric
 
The loop goes through all forms in your database.

If you just want to change one form, it would be easier to do it by hand.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top