Listbox with variable?

  • Thread starter Thread starter Court
  • Start date Start date
C

Court

Hi,

I have a listbox that contains 3 columns (3 fields from
an 8 field table), and it populates the rowsource with
essentially a query. However, Id like the other fields
(not in the listbox) to be put into variables as they
scroll down the list so they can find the details of any
one row in the listbox.

If that doenst make sense, I have 3 columns in listbox,
which shows 3 fields of information, if they click one
one of the rows, i want to display all 8 fields, thus i
need the remaining 5 as variables to temporarily display.
Thanks in advance.

Court
 
Court
Create a listbox with 8 columns and set the width of the
ones you don't want to see to zero
1.0;2.0;3.5;0;0;0;0;0
Then create your textboxes (hidden maybe?) and the
Controlsource is listboxname.column(5)
I think the columns start at 0 not 1
HTH
Stephen
 
Hey,

You could try inserting:

Me.RecordSource = "SELECT * FROM test2 WHERE primaryKey='"
& Me.listBox1.Column(0) & "';"

in the AfterUpdate section of the ListBox. Everytime a
user selects a new value from the listbox, all the bound
fields on your form will display your missing data.

Hope this helps.

Regards,
Eric
 
Court,

Would you consider an alternative to Listview?
How about a combination ListView / TreeView.

Put primary data into columns of root nodes
so this is always seen, and then expand the node
when user clicks on it so you can show the other
three columns as a child node.

There are several commercial controls that may offer this
functionality - Our TList control is one option.


Jeff Bennett President
(e-mail address removed)

Bennet-Tec Information Systems, Inc
50 Jericho Tpk, Jericho, NY 11753
Phone 516 997 5596, Fax - 5597
WWW.Bennet-Tec.Com

RELIABLE Component Software
and Software Development Services
* TList/Pro * ALLText HT/Pro * MetaDraw *

====================== ======================
 
Back
Top