How do I wrap text into a list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys I have a set of list boxes that retrieve data from a table just one
item each, I would normally use a set of text boxes for this but I cant get
the selector to work such that it only selects on of the coloumns from the
row ie one cell.
bassically my question is how do you wrap text in a listbox and or How do
you get a textbox to select only one cell.
Thanks
 
You can't wrap text in a listbox.

To select only a specific column from the listbox, you use the Column
collection (which starts numbering at 0).

Assuming that the listbox doesn't allow multiselect (and you're referring to
it from the code module associated with the form that it's on), you'd refer
to the 3rd column of the selected row as:

Me!MyListbox.Column(2)

You'd refer to the 3rd column of the 2nd row of the listbox as:

Me!MyListbox.Column(2, 1)

If you're trying to refer to data in a listbox on another form, you'd use

Forms!MyForm!MyListbox.Column(2)

and

Forms!MyForm!MyListbox.Column(2, 1)

respectively
 
Sorry Douglas I'm not sure I quite understand If I list box cant word wrap
all I want then is a text box to look up a feild in one of my tables. ie if I
have a table named tblX and I want the text box to show the data that is held
in row 2 of column 3 how would I go about doing that.
Thanks again
-Steve
 
To have a text box display data from a table, you either need to have that
table as part of the form's RecordSource, and bind the text box to the
appropriate field, or else you can set the text box's ControlSource to use
the DLookup function.

You can't, however, refer to "row 2" of a table: you can never make any
assumptions about the order in which data is stored in tables. If the
sequence of the data is important, you must have appropriate fields in the
table that can be used in the ORDER BY clause of a query, and use the query
rather than the table.
 
Back
Top