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

List box column,row as control source

P: n/a
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSource Property is set to "= List1.Column(0,2)"
in design view.
When I open the form, Text1 does not display the value of
List1.Column(0,2)
Am I missing something?
Aug 20 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
when you set the control source of an unbound textbox to "=" another
control, you're setting it to the *value* in that control. a listbox
control's value is equal to the bound column of the selected record in the
listbox control's RowSource. the value of other columns can be referred to,
but only for the *selected* row. i think you're going to have to select row
2 in the listbox, then you can display the value of column 0 from that row,
in your textbox control.

hth
"Lou O" <lg********@gmail.comwrote in message
news:4b**********************************@p25g2000 hsf.googlegroups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSource Property is set to "= List1.Column(0,2)"
in design view.
When I open the form, Text1 does not display the value of
List1.Column(0,2)
Am I missing something?

Aug 20 '08 #2

P: n/a
On Aug 19, 10:28*pm, "tina" <nos...@address.comwrote:
when you set the control source of an unbound textbox to "=" another
control, you're setting it to the *value* in that control. a listbox
control's value is equal to the bound column of the selected record in the
listbox control's RowSource. the value of other columns can be referred to,
but only for the *selected* row. i think you're going to have to select row
2 in the listbox, then you can display the value of column 0 from that row,
in your textbox control.

hth

"Lou O" <lgeastw...@gmail.comwrote in message

news:4b**********************************@p25g2000 hsf.googlegroups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSource Property is set to "= List1.Column(0,2)"
in design view.
When I open the form, Text1 does not display the value of
List1.Column(0,2)
Am I missing something?
I discovered something interesting by chance. If I reverse the
(column,row) to (row/column) of the listbox, I can set the
ControlSource of any textbox on the form to display the data of the
specified row & column. Cool; just what I wanted. I wonder though if
this is standard or just a fluke that is not supported by MS. If I
build my form on this premiss, am I going to have trouble down the
road?
Aug 23 '08 #3

P: n/a
i don't know. how did you reverse it?
"Lou O" <lg********@gmail.comwrote in message
news:18**********************************@d77g2000 hsb.googlegroups.com...
On Aug 19, 10:28 pm, "tina" <nos...@address.comwrote:
when you set the control source of an unbound textbox to "=" another
control, you're setting it to the *value* in that control. a listbox
control's value is equal to the bound column of the selected record in the
listbox control's RowSource. the value of other columns can be referred
to,
but only for the *selected* row. i think you're going to have to select
row
2 in the listbox, then you can display the value of column 0 from that
row,
in your textbox control.

hth

"Lou O" <lgeastw...@gmail.comwrote in message

news:4b**********************************@p25g2000 hsf.googlegroups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSource Property is set to "= List1.Column(0,2)"
in design view.
When I open the form, Text1 does not display the value of
List1.Column(0,2)
Am I missing something?
I discovered something interesting by chance. If I reverse the
(column,row) to (row/column) of the listbox, I can set the
ControlSource of any textbox on the form to display the data of the
specified row & column. Cool; just what I wanted. I wonder though if
this is standard or just a fluke that is not supported by MS. If I
build my form on this premiss, am I going to have trouble down the
road?
Aug 23 '08 #4

P: n/a
On Aug 23, 10:19*am, "tina" <nos...@address.comwrote:
i don't know. how did you reverse it?

"Lou O" <lgeastw...@gmail.comwrote in message

news:18**********************************@d77g2000 hsb.googlegroups.com...
On Aug 19, 10:28 pm, "tina" <nos...@address.comwrote:
when you set the control source of an unbound textbox to "=" another
control, you're setting it to the *value* in that control. a listbox
control's value is equal to the bound column of the selected record in the
listbox control's RowSource. the value of other columns can be referred
to,
but only for the *selected* row. i think you're going to have to select
row
2 in the listbox, then you can display the value of column 0 from that
row,
in your textbox control.
hth
"Lou O" <lgeastw...@gmail.comwrote in message
news:4b**********************************@p25g2000 hsf.googlegroups.com....
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSource Property is set to "= List1.Column(0,2)"
in design view.
When I open the form, Text1 does not display the value of
List1.Column(0,2)
Am I missing something?

I discovered something interesting by chance. If I reverse the
(column,row) to (row/column) of the listbox, I can set the
ControlSource of any textbox on the form to display the data of the
specified row & column. Cool; just what I wanted. I wonder though if
this is standard or just a fluke that is not supported by MS. If I
build my form on this premiss, am I going to have trouble down the
road?
Sorry I wasn't clear. I did not reverse the listbox control itself.
I simply referenced it's (column,row) properties for the ControlSource
of a text box in design mode.
Instead of Text1.ControlSource Property "= List1.Column(column,row)"
which is the common way.
("row" is the list "index" of a list box)
I reversed the (column,row) to (row,column)
Example: Text1.ControlSource "= List1.Column(row,column)" .
It works every time for several dozen text boxes each referencing
different rows and columns of the same list box.
I just hope it keeps working and isn't just an anomaly not supported
by MS.

Aug 23 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.