List all labels of all forms Access DB
I would like to loop through all forms and for each form (open and closed) view all labels...
Anders
Web Development
I would like to loop through all forms and for each form (open and closed) view all labels...
Anders
by fofa
by ae_maillist
by andrew
Try this:
Dim f As Form
Dim c As Control
For Each f In Access.Forms
For Each c In f.Controls
If TypeOf c Is Label Then MsgBox c.Properties("Name")
Next
Next
by ae_maillist
This works:
Dim i As Integer
Dim f As Form
Dim c As control
For i = 1 To Application.CurrentProject.AllForms.Count
DoCmd.OpenForm Application.CurrentProject.AllForms.Item(i).Name
For Each f In Access.forms
For Each c In f.Controls
If TypeOf c Is Label Then
MsgBox f.Name & ", " & _
c.Properties("Name") & _
c.Properties("caption")
End If
Next c
Next f
DoCmd.Close
Next i
Thasnks for the inspiration...
by ae_maillist
This discussion is closed to new replies.
Sort by Trending