Control Type Property acComboBox

B

BaBaBo

Dear All:

This question is regarding the following code.

Dim ctl As Control

WHAT I UNDERSTAND ABOUT THE ABOVE CODE
I understand that we are creating a Dimention to store the "Intrinsic
Constant" value for what ever type of control, such as combobox or text box
etc, the procedure is focused on.

I also understand that being I am intrested specifically in a combobox I
could write:

Dim ctl As acComboBox

WHAT I DO NOT UNDERSTAND ABOUT THE CODE
and can not find online is:

What is the acComboBox intrinsic constant value?

Is it an index number or a string or a Boolan.

The following statement taken from:
http://msdn.microsoft.com/en-us/library/aa158802(office.10).aspx

The ControlType property setting is an intrinsic constant that specifies the
control type.

The above statement confuses me. Is it saying the acComboBox value is the
entirity of all of the standard properties for a combobox?

Thanks in advance for all your help.
 
S

Stuart McCall

Comments inline:

BaBaBo said:
Dear All:

This question is regarding the following code.

Dim ctl As Control

WHAT I UNDERSTAND ABOUT THE ABOVE CODE
I understand that we are creating a Dimention to store the "Intrinsic
Constant" value for what ever type of control, such as combobox or text
box
etc, the procedure is focused on.

No. What you're doing is creating a variable (ctl) which may refer to any
existing control.
You would normally follow this with the actual assignment:

Set ctl = MyControl

(assuming you have a control called MyControl)
I also understand that being I am intrested specifically in a combobox I
could write:

Dim ctl As acComboBox

No. Intrinsic constants are not objects. You should declare it thus:

Dim ctl As Access.ComboBox

Notice I 'disambiguated' the control name by prefixing it with Access. When
you type that in and you get to the dot, Access will drop down a list of its
objects, so you can pick one without having to remember the exact spelling
etc.
WHAT I DO NOT UNDERSTAND ABOUT THE CODE
and can not find online is:

What is the acComboBox intrinsic constant value?

Whenever you want to find a constant's value, type it into the immediate
window. Press Ctrl-G to open the VBE environment and bring the immediate
window into view. Type:

?acComboBox

Access will respond with 111 (the code used to identify the type of control.
Is it an index number or a string or a Boolan.

The following statement taken from:
http://msdn.microsoft.com/en-us/library/aa158802(office.10).aspx

The ControlType property setting is an intrinsic constant that specifies
the
control type.

The above statement confuses me. Is it saying the acComboBox value is the
entirity of all of the standard properties for a combobox?

Sorry, I don't understand the question, but to find all the properties for a
combobox, open Help and search for 'combo box object' (without the quotes).
When you get to the right page, click 'Properties' at the top of the page.
 
J

Jack Leach

Dim ctl As Control
WHAT I UNDERSTAND ABOUT THE ABOVE CODE
I understand that we are creating a Dimention to store the "Intrinsic
Constant" value for what ever type of control, such as combobox or text box
etc, the procedure is focused on.

I'm not *positive*, but I am pretty sure this is incorrect. The Type
Control is exactly that... a reference to a control, and all properties that
go with it (including it's type).

What is the acComboBox intrinsic constant value?

Is it an index number or a string or a Boolan.

The following statement taken from:
http://msdn.microsoft.com/en-us/library/aa158802(office.10).aspx

The ControlType property setting is an intrinsic constant that specifies the
control type.


The ControlType, as stated, is simply a property of the Control that states
what type it is. My guess would be that the datatype of this particular
control is either an Integer or Long. So... note that the Control (object)
can be a control of any particular type (text, combo, list, image, tab, etc).

You may try in the immediate window...

?acComboBox

.... to see the actual value of the constant, or...

?Forms("frmname").Controls("ctlname").ControlType

.... to see the type of control that it is (or rather, the value of the
constant)



hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
B

BaBaBo

Dear Jack:

Thanks for your response.

So what your saying is that the code is creating a connection to the
control, but how will it know what control you are connecting to.

Man this is complicated.

What is the pont can you give me some idea of why this is needed, if you can
explain some code then I could get it.

Thanks again.
 
B

BaBaBo

Thanks Jack much appreciated.

I am getting there with your help.

Yours truly.

Anthony
 

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