Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Cincinnati, Ohio
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display multiple colums from combo box (2003)

    Can a combo box display multiple columns after a value has been selected? I have a combo box on a form with four fields (ID, Name, Cell, Home), ID is hidden with a width of 0. All the fields display when browsing the combo box but only name diplays after a selection is made. Is it possible to display all the non-zero width fields on the form after a selection is made? Thank you! -scott

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Display multiple colums from combo box (2003)

    There's a couple of ways to do this:
    1. Concatenate the fields together in the Combo and display this concatenated field, nasty solution., or
    2. Provide unbound controls on the form that you populate in the AfterUpdate event of the ComboBox field. The ComboBox fields can be references by ComboBoxName.Column(nnn) where nnn is a base zero number. ie. the first column is ComboBoxName.Column(0), the 2nd column is ComboBoxName.Column(1) etc

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Display multiple colums from combo box (2003)

    The text box part of a combo box only displays the first column whose column width is greater than zero (the dropdown list part displays all columns whose column width is greater than zero).

    If you want to display multiple columns, you can use a list box, or you can use text boxes, one for each additional column. The Control Source of those text boxes would look like

    =[ComboBoxName].[Column](2)

    for the 3rd column, where ComboBoxName is the name of the combo box. The column index starts counting at 0, so Column(2) is actually the 3rd column.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Cincinnati, Ohio
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Display multiple colums from combo box (2003)

    That did it. Thank you for the options and explanation. - scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •