loop thru "all:" forms in a current project

M

Mark Kubicki

I would like to loop thru all of the forms in a current project (whether the
forms are open, loaded or not) (and change the background color of the formm
header to a public constant.)

It seems as though the "forms" collection only accesses those that are open.

how would I access "all" form?


thanks in advance,
mark
 
K

Klatuu

Here is a sample routine that loops through all the forms in an mdb:

Public Sub ShowForms()
Dim frm As Object

For Each frm In CurrentProject.AllForms
'You code goes here
Debug.Print frm.Name
Next frm
End Sub

Note, to make the changes, you will need to open the form in design view (it
can also be hidden), make the changes and close the form and save it. it
would be like

docmd.Close acForm, strFormName, acSaveYes
 

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

Top