Tags: access, box, boxes, cant, database, guys, microsoft, mysql, normally, oneitem, oracle, retrieve, sql, table, text, wrap

How do I wrap text into a list box

On Database » Microsoft Access

4,738 words with 3 Comments; publish: Sun, 01 Jun 2008 12:53:00 GMT; (25078.13, « »)

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

All Comments

Leave a comment...

  • 3 Comments
    • 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

      Doug Steele, Microsoft Access MVP

      http://I.Am/DougSteele

      (no private e-mails, please)

      "steveatdb" <steveatdb.ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:CF025127-75A1-483F-888A-6D09BA85B478.ms-access.todaysummary.com.microsoft.com...

      > 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

      #1; Sun, 01 Jun 2008 12:54:00 GMT
    • 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

      "Douglas J. Steele" wrote:

      > 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

      > --

      > Doug Steele, Microsoft Access MVP

      > http://I.Am/DougSteele

      > (no private e-mails, please)

      >

      > "steveatdb" <steveatdb.ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      > news:CF025127-75A1-483F-888A-6D09BA85B478.ms-access.todaysummary.com.microsoft.com...

      >

      >

      #2; Sun, 01 Jun 2008 12:55:00 GMT
    • 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.

      Doug Steele, Microsoft Access MVP

      http://I.Am/DougSteele

      (no e-mails, please!)

      "steveatdb" <steveatdb.ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:A830F7D8-B63F-4210-A5B1-B2F8454952BD.ms-access.todaysummary.com.microsoft.com...[vbcol=seagreen]

      > 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

      > "Douglas J. Steele" wrote:

      #3; Sun, 01 Jun 2008 12:56:00 GMT