473,614 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List box column,row as control source

Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSo urce 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
4 13936
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********@gma il.comwrote in message
news:4b******** *************** ***********@p25 g2000hsf.google groups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSo urce 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
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...@gma il.comwrote in message

news:4b******** *************** ***********@p25 g2000hsf.google groups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSo urce 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
i don't know. how did you reverse it?
"Lou O" <lg********@gma il.comwrote in message
news:18******** *************** ***********@d77 g2000hsb.google groups.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...@gma il.comwrote in message

news:4b******** *************** ***********@p25 g2000hsf.google groups.com...
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSo urce 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
On Aug 23, 10:19*am, "tina" <nos...@address .comwrote:
i don't know. how did you reverse it?

"Lou O" <lgeastw...@gma il.comwrote in message

news:18******** *************** ***********@d77 g2000hsb.google groups.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...@gma il.comwrote in message
news:4b******** *************** ***********@p25 g2000hsf.google groups.com....
Is it possible to use the row (index) of a list box as control source
Property for a text box?
Example: Text1.ControlSo urce 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.ControlSo urce Property "= List1.Column(co lumn,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.ControlSo urce "= List1.Column(ro w,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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3386
by: Ed | last post by:
Hello! I have a report that includes a subreport. They are linked together by a common ID field. The subreport contains 6 controls, 5 of them text boxes with a control source and one of them is a list box based on a query. The text boxes that have a control source show the correct data for multiple records of the subreport but the listbox is only queried once and it does not change for other records.
9
7418
by: Jack | last post by:
In the control source of a textbox, is there a way to refer to a column of a combobox? For example: =.Column(2) Thanks, Jack
4
2703
by: VivN | last post by:
I want to use an expression as the control source for a text box in a report (Access 2000). Whilst I have sucessfully used these simple ones =TimeToSingle(TotalHours(,)) =TimeToSingle(BHolHours(,,)) I get problems when I include a text parameter Scale (control just displays #error)
5
371
by: sparks | last post by:
This morning I was adding some fields in a database. I double clicked on the control source field to highlight and copy the control name into the name of the control..well I have done this a thousand times. Wait I have a problem. name---text241 control sourse---address double click control sourse to get address and paste it in name .. now I have
2
4903
by: jerry.ranch | last post by:
I've been using row source with the QBE for my list and combo boxes..when would I use control source? jerry
3
4425
by: ChasW | last post by:
This should be most simple to do, and I am doing it elsewhere in the very same form, but for some reason it is not working in this case. My form uses a query as its Record Source. In the form view, I simply want to append some text to the view of this field in the form using the control source. The field name is: artist. This works fine for the control source: artist
4
8968
by: Bruce Skamser | last post by:
I added a field to a table and when I go to the form to add a textbox control, I can't bind it to the field in the table. It doesn't come up in the list of fields in the control source dropdown. What can I be doing wrong?
1
4622
gcoaster
by: gcoaster | last post by:
Hello Group, I was wondering if anyone out there can help me I have a form Unbound List Box Control on the form The row source is a built-in query. I was wondering if there is anyway to display the columns in the Unbound List Box Control as RICH TEXT.
24
7153
angus macgyver
by: angus macgyver | last post by:
hi, i have a simple database that maintains customer info in one table and their orders in another. when adding a new order for a customer i would like the customer name and id at the top of the new order form 'formorder' when the form is opened (it is opened with the button 'baddorder' on the form 'formcustomers') u basically choose the customer from a drop down list on the splash screen and can view the customer info (address, telephone)...
0
8180
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8576
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8275
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8429
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5538
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4050
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4121
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.