By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,472 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,472 IT Pros & Developers. It's quick & easy.

Referring to combo box controls on forms in A97

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.