How to loop through closed Forms?

D

deko

How do I loop through all CLOSED forms in my Access 2007 accdb?

This only works for OPEN forms:

Dim frms as Forms
Dim frm as Form

For Each frm in frms
Debug.Print frm.Name
Next frm

Thanks
 
B

Banana

deko said:
How do I loop through all CLOSED forms in my Access 2007 accdb?

This only works for OPEN forms:

Dim frms as Forms
Dim frm as Form

For Each frm in frms
Debug.Print frm.Name
Next frm

Thanks

Look in the help files for 'AllForms' collection. Alternatively, there's
also Containers & Documents collections which you can obtain with this:

CurrentDb.Containers("Forms").Documents...
 
D

deko

Look in the help files for 'AllForms' collection. Alternatively, there's
also Containers & Documents collections which you can obtain with this:

CurrentDb.Containers("Forms").Documents...

AllForms is the ticket...

Dim obj As AccessObject
For Each obj In CurrentProject.AllForms
strFrm = obj.Name
Next obj
 
D

De Jager

deko said:
How do I loop through all CLOSED forms in my Access 2007 accdb?

This only works for OPEN forms:

Dim frms as Forms
Dim frm as Form

For Each frm in frms
Debug.Print frm.Name
Next frm

Thanks
 
V

valeria del colle

"deko" <[email protected]> ha scritto nel messaggio
Look in the help files for 'AllForms' collection. Alternatively, there's
also Containers & Documents collections which you can obtain with this:

CurrentDb.Containers("Forms").Documents...

AllForms is the ticket...

Dim obj As AccessObject
For Each obj In CurrentProject.AllForms
strFrm = obj.Name
Next obj
 

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