Intrinsic Constant Value

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.
 
D

Dirk Goldgar

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
 
J

Janie

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)
 

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