listing open forms

K

Kevin S.

Does anybody know how to list all open forms in a listbox? Or a
database/site that can show me how? Im using Access 2002.

I've tried looking at the sample in the Solutions database that comes with
Access 97, but after an hour or two of trying to get that to work, I gave
up. (it lists all records open in the same form but different windows... I
actually want every form thats open because my database doesn't need two
copies of a form running)

Thanks for any help... I can't get it to work at all.
Guessing... do I need to use a collection? The sample 97 db does.

-Kevin
 
G

Gerald Stanley

The collection of open forms is accessible through the
Forms collection so you sould try something along the
following lines

Dim frm as Access.Form
Dim strRowSource as String

For Each frm in Forms
strRowSource = strRowSource & frm.Name & ";"
Next

List0.RowSource = Left(strRowSource, Len(strRowSource)-1)
List0.RowSourceType = "Value List"

Hope This Helps
Gerald Stanley MCSD
 

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