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

Set control source =[cbxName].column(2)

P: n/a
In the control source of a textbox, is there a way to refer to a column of a
combobox? For example:
=[CbxName].Column(2)

Thanks,
Jack
Nov 13 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Jack wrote:
In the control source of a textbox, is there a way to refer to a column of a
combobox? For example:
=[CbxName].Column(2)

Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.

--
Marsh
MVP [MS Access]
Nov 13 '05 #2

P: n/a
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.

Jack

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:2l********************************@4ax.com...
Jack wrote:
In the control source of a textbox, is there a way to refer to a column of acombobox? For example:
=[CbxName].Column(2)

Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.

--
Marsh
MVP [MS Access]

Nov 13 '05 #3

P: n/a
In the after update event of your combo box type in:

txtTextBoxName=cbxName.column(2)

That should do it.

dixie

"Jack" <pa***@nmurphy.com> wrote in message
news:US*****************@newsread2.news.atl.earthl ink.net...
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.

Jack

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:2l********************************@4ax.com...
Jack wrote:
>In the control source of a textbox, is there a way to refer to a column of a >combobox? For example:
>=[CbxName].Column(2)

Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.

--
Marsh
MVP [MS Access]


Nov 13 '05 #4

P: n/a
#Name implies that you spelled the name of the combo box
incorrectly or left out the = sign.

However, this isn't going to do what you want in a
continuous (sub)form. All copies of the text box will
display the same value because there is only one combo box
control (the current record).
--
Marsh
MVP [MS Access]
Jack wrote:
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.

Jack wrote:
>In the control source of a textbox, is there a way to refer to a columnof a >combobox? For example:
>=[CbxName].Column(2)


"Marshall Barton" wrote
Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.


Nov 13 '05 #5

P: n/a
Perhaps the problem is the square brackets around the combo box name.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Marshall Barton" <ma*********@wowway.com> wrote in message
news:ku********************************@4ax.com...
#Name implies that you spelled the name of the combo box
incorrectly or left out the = sign.

However, this isn't going to do what you want in a
continuous (sub)form. All copies of the text box will
display the same value because there is only one combo box
control (the current record).
--
Marsh
MVP [MS Access]
Jack wrote:
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.

Jack wrote:
>In the control source of a textbox, is there a way to refer to a column

of a
>combobox? For example:
>=[CbxName].Column(2)

"Marshall Barton" wrote
Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.

Nov 13 '05 #6

P: n/a
Douglas J. Steele wrote:
Perhaps the problem is the square brackets around the combo box name.


I don't think so Doug. The expression parser seems to add
(A97) and remove (AXP) square brackets at its own whim,
regardless of how it's originally typed.

--
Marsh
MVP [MS Access]
Nov 13 '05 #7

P: n/a
A continuous form will correctly display the 3rd column for each different
record.

Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
"Marshall Barton" <ma*********@wowway.com> wrote in message
news:ku********************************@4ax.com...
#Name implies that you spelled the name of the combo box
incorrectly or left out the = sign.

However, this isn't going to do what you want in a
continuous (sub)form. All copies of the text box will
display the same value because there is only one combo box
control (the current record).
--
Marsh
MVP [MS Access]
Jack wrote:
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.

Jack wrote:
>In the control source of a textbox, is there a way to refer to a column

of a
>combobox? For example:
>=[CbxName].Column(2)

"Marshall Barton" wrote
Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.

Nov 13 '05 #8

P: n/a
Thanks, Duane, for your response!

<<Make sure the name of the control is not also the name of a field.>>

Access defaults to naming a control the same as the name of the field. Why
does it have to be changed?

Jack

"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
A continuous form will correctly display the 3rd column for each different
record.

Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
"Marshall Barton" <ma*********@wowway.com> wrote in message
news:ku********************************@4ax.com...
#Name implies that you spelled the name of the combo box
incorrectly or left out the = sign.

However, this isn't going to do what you want in a
continuous (sub)form. All copies of the text box will
display the same value because there is only one combo box
control (the current record).
--
Marsh
MVP [MS Access]
Jack wrote:
It didn't work. I got the #Name error.

The cbx has three columns, column count = 3, and I need to refer to the
third column.

This is in a subform where the subform is continuous.
Jack wrote:
>In the control source of a textbox, is there a way to refer to a columnof a
>combobox? For example:
>=[CbxName].Column(2)
"Marshall Barton" wrote
Exactly like that. Just note that the column number is zero
based.

Did you try it? If it didn't work, what happened.


Nov 13 '05 #9

P: n/a
If you don't change it in this case, ACCESS will assume that you mean the
field to which the control is bound, not the control, and the code will
error because a field does not have a Column property.

--

Ken Snell
<MS ACCESS MVP>

"Jack" <pa***@nmurphy.com> wrote in message
news:1E*****************@newsread3.news.atl.earthl ink.net...
Thanks, Duane, for your response!

<<Make sure the name of the control is not also the name of a field.>>

Access defaults to naming a control the same as the name of the field. Why
does it have to be changed?

Jack

"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
A continuous form will correctly display the 3rd column for each
different
record.

Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
"Marshall Barton" <ma*********@wowway.com> wrote in message
news:ku********************************@4ax.com...
> #Name implies that you spelled the name of the combo box
> incorrectly or left out the = sign.
>
> However, this isn't going to do what you want in a
> continuous (sub)form. All copies of the text box will
> display the same value because there is only one combo box
> control (the current record).
> --
> Marsh
> MVP [MS Access]
>
>
> Jack wrote:
>>It didn't work. I got the #Name error.
>>
>>The cbx has three columns, column count = 3, and I need to refer to the
>>third column.
>>
>>This is in a subform where the subform is continuous.
>>
>>
>>> Jack wrote:
>>> >In the control source of a textbox, is there a way to refer to a column >>of a
>>> >combobox? For example:
>>> >=[CbxName].Column(2)
>>>
>>>
>>"Marshall Barton" wrote
>>> Exactly like that. Just note that the column number is zero
>>> based.
>>>
>>> Did you try it? If it didn't work, what happened.
>



Nov 13 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.