Using the Object Browser, ControlType is a property of a BoundObjectFrame, a
CheckBox, a ComboBox, etc, i.e. it is a property of the individual control
types and not a property of the Control class in general.
Your example works, therefore, because c is a TextBox and the TextBox has
the property. However, it does not show in the list of the properties of the
Control, because it is not a property of the control, but of the text box.
Well, that's how it is supposed to work anyway. There are still cases where
Access does not show the property of an object. For example, if you place a
PageBreak control on a report, and then refer to it in code, Access does not
show that it has a Visible property, even though it does according to the
Object Browser.
The Object Brower is still best resource available, especially if you
right-click it and click Show Hidden Members.
There are some other quirks as well. For example, if the RecordSource of
your form includes a field that is not represented by a control on your
form, naturally enough the field is not listed if you enumerate the Controls
collection of the form. However, it still works if you use:
Forms.Controls("MyField")
even though the field is not a control, and Controls.Count does not include
it. It's an object of type AccessField, and lives in that netherworld where
it works on forms (most of the time), but not on reports (some of the time).
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Georg Scholz" <ge**********@vienna.at> wrote in message
news:cd**************************@posting.google.c om...
Hello,
The class "Control" contains a documented Property "ControlType".
So for example, in a form, you can write code like this:
Dim c as control
set c = me.Controls("textbox1")
if c.ControlType = acTextBox then
...
This works fine. However, the ControlType property does neither show
up in the Autocomplete list, nor in the Object Browser.
Does anyone know why this is the case ?
My issue behind this is, that a class might contain a lot more of
members than as listed in the AutoComplete List or in the Object
Browser. So my 2nd question is how to get a complete list of members
for any class.
Thanks in advance
Georg Scholz
www.scholz-informatik.at