Link text-boxes to list-box entries

M

MildJoe

Is it possible to link different controls (text-boxes ) to a list-box in the
same form?

I have a listbox with different versions of a drawing. (Drawing1; v1, v2, v3
,v4 etc)
I want to point at one entry in the list-box, and different text-boxes will
show the details of that version of the drawing. (release date, signature,
info etc)
 
S

Stefan Hoffmann

hi,
Is it possible to link different controls (text-boxes ) to a list-box in the
same form?
Use "=Listbox.Column(n)" as ControlSource.


mfG
--> stefan <--
 
M

MildJoe

thanks Stefan!
i'm onto something now. but not there yet.
Could you help me some more?

This is how it is:

Listbox:
ID Version
Drawing1 1
Drawing1 2
Drawing1 3

Textbox1 : "version"
Textbox2 : "signature"

I want Textbox1 to show the version when i click at a row in the listbox.
And i want Textbox2 to show the versions corresponding signature. This
signature is saved in the table with the version, but it is not in the
Listbox. I also want the listbox row to change color, or do something to
show that its the "active" row.

Am I making any sense?
 
S

Stefan Hoffmann

hi,
Listbox:
ID Version
Drawing1 1
Drawing1 2
Drawing1 3
So your RowSource is something like

Listbox.RowSource = "SELECT ID, Version FROM YourTable"
Textbox1 : "version"
Textbox2 : "signature"

I want Textbox1 to show the version when i click at a row in the listbox.
And i want Textbox2 to show the versions corresponding signature.
Change the listbox RowSource to

Listbox.RowSource = "SELECT ID, Version, Signature FROM YourTable"

Set

ColumnCount = 3
ColumnWidths = 1cm;5cm;0cm

Use the appropriate measure in ColumnWidths, in Germany it's cm
(Centimeter).
The third column is not visible in the list, because its width is set to
zero.
signature is saved in the table with the version, but it is not in the
Listbox.
Set the ControlSources:

Textbox1.ControlSource = "=Listbox.Column(1)"
Textbox2.ControlSource = "=Listbox.Column(2)"

Use the property editor to do the changes.
I also want the listbox row to change color, or do something to
show that its the "active" row.
The listbox should do this itself by default.
Am I making any sense?
Yup, hopefully you can apply my hints.


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top