Intrinsic Constant Value

  • Thread starter Thread starter Janie
  • Start date Start date
J

Janie

I'm printing a list of controls on a form.

Using the ControlType property I get the numeric value of the Intrinsic
Constant as in 100 for a Label, 104 for a Command Button.

How do I have the Constant's Name display rather than the Constant's Value?

For Counter = 0 To MyCount - 1
With frm.Controls(Counter)
Debug.Print .Name & vbTab & .ControlType
End With
Next

Thanks for suggestions.
 
Janie said:
I'm printing a list of controls on a form.

Using the ControlType property I get the numeric value of the Intrinsic
Constant as in 100 for a Label, 104 for a Command Button.

How do I have the Constant's Name display rather than the Constant's
Value?

For Counter = 0 To MyCount - 1
With frm.Controls(Counter)
Debug.Print .Name & vbTab & .ControlType
End With
Next

Thanks for suggestions.


You could ignore the constant and extract the name of the object type:

Dim frm As Access.Form
Dim ctl As Access.Control

Set frm = Forms!SomeOpenForm

For Each ctl In frm.Controls
Debug.Print ctl.Name, TypeName(ctl)
Next

Set frm = Nothing
 
EXACTLY!!!!!!!

Dirk Goldgar said:
You could ignore the constant and extract the name of the object type:

Dim frm As Access.Form
Dim ctl As Access.Control

Set frm = Forms!SomeOpenForm

For Each ctl In frm.Controls
Debug.Print ctl.Name, TypeName(ctl)
Next

Set frm = Nothing


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top