Forms captions

FloBob

Registered User.
Local time
Today, 15:28
Joined
Jul 19, 2002
Messages
108
I know I can go through the forms and find there names externally but is there a way to pick out there Captions?

Code:
For Each objFRM In Application.CurrentProject.AllForms
    whatever = objfrm.caption
Next

Somthing similar to that code?... (this doesnt work btw P)
 
The .AllForms collection only has a few useful properties, Caption not being one of them. You can use the Access Forms collection to get at the Caption property, but the Forms collection only contains open forms. There's got to be an easier way of doing this, but this is what I came up with:
Code:
Sub GetFormCaptions()
Dim frm As AccessObject

    For Each frm In Application.CurrentProject.AllForms
        DoCmd.OpenForm frm.Name, acNormal, , , , acHidden
        Debug.Print Forms(frm.Name).Caption
        DoCmd.Close acForm, frm.Name
    Next
End Sub
 

Users who are viewing this thread

Back
Top Bottom