469,270 Members | 1,114 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Referring to combo box controls on forms in A97

MLH
Somehow, I seem to be able to refer to combo-box controls
in 2 distinctly different ways. A combo-box on an Access 97
form named TagCountyChooserBox seems can be referenced
these ways...

Forms![frmVehicleEntryForm]![TagCountyChooserBox]
and
Forms![frmVehicleEntryForm]![TagCounty]

where TagCounty is the datasource fieldname of the
TagCountyChooserBox control. How is that? I never
remember observing this behavior in Access 2.0. Is it
normal?
Nov 13 '05 #1
4 1994
MLH wrote:
Somehow, I seem to be able to refer to combo-box controls
in 2 distinctly different ways. A combo-box on an Access 97
form named TagCountyChooserBox seems can be referenced
these ways...

Forms![frmVehicleEntryForm]![TagCountyChooserBox]
and
Forms![frmVehicleEntryForm]![TagCounty]

where TagCounty is the datasource fieldname of the
TagCountyChooserBox control. How is that? I never
remember observing this behavior in Access 2.0. Is it
normal?


The second one is NOT referring to the ComboBox. It is referring to the
field named TagCounty.

AFAIK you have always been able to refer to any field in the form's fields
collection. Even those that don't have controls bound to them.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #2
MLH
The behaviour seems limited to expressions entered in the ComboBox
event properties. If I refer to the control with the intent of say...
changing its backcolor property, an expression referring to the
ComboBox either way will succeed in changing the color, but code
will not.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The second one is NOT referring to the ComboBox. It is referring to the
field named TagCounty.

AFAIK you have always been able to refer to any field in the form's fields
collection. Even those that don't have controls bound to them.


Nov 13 '05 #3
MLH wrote:
A combo-box on an Access 97
form named TagCountyChooserBox seems can be referenced
these ways...

Forms![frmVehicleEntryForm]![TagCountyChooserBox]
and
Forms![frmVehicleEntryForm]![TagCounty]

where TagCounty is the datasource fieldname of the
TagCountyChooserBox control. How is that? I never
remember observing this behavior in Access 2.0. Is it
normal?


Yes, definitely, if:

1) the controlsource of the combo box is bound to the field TagCountry, and

2) the bound column of the combobox returns the value for TAGCountry, as
opposed to some other value that a the rowsource for the combo box provides.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #4
MLH wrote:
The behaviour seems limited to expressions entered in the ComboBox
event properties. If I refer to the control with the intent of say...
changing its backcolor property, an expression referring to the
ComboBox either way will succeed in changing the color, but code
will not.


Again, because the second one is refering directly to the field in the
table, not to the ComboBox. A field has no BackColor, only a control does.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Mark Rae | last post: by
7 posts views Thread by Doug | last post: by
13 posts views Thread by mirandacascade | last post: by
3 posts views Thread by evenlater | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.