I would like to be able to get the Type of the control in code for a designed form. Is this possible?
Something similar to what you can do with a “fcControlDlg”:
‘ works for a fcContolDlg
Set Dlg = Utilities.NewControlBoxDialog
‘ define dialog properties here
Set EditControl = Dlg.AddEditControl
‘define control properties here
Set CL = Dlg.ControlList
For i = 0 To CL.Count – 1
Utilities.Trace i & ” ” & CL.Item(i).Caption & “=” & CL.Item(i).ControlType
‘ non-working attempt for a Designed Form
For i = 0 To TestForm.ComponentCount-1
Set thisComponent = TestForm.Components(i)
Utilities.Trace i & ” = ” & thisComponent.Caption & “=” & thisComponent.ControlType ‘ <- Does not work
I’ve also tried to iterate through “TestForm.Controls” instead of “TestForm.Components.”
- You must be logged in to reply to this topic.