Results 1 to 6 of 6
  1. #1
    statty01 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    2

    display multiple fields combo box


    Hi,
    I have created a combo box, that when I hit the drop down arrow 3 fields appear - name, dob, time.
    But when I choose my option, only the first field is displayed whereas I would like to display all three fields. I have tried everything.
    Any suggestions?

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You have 2 options. The first option is to concatenate the three fields into one by using a query and then base the combo box on the query. The SQL text of the query would look like this. This will display the name followed by a space then the date of birth and then another space followed by the time

    SELECT [name] & " " & dob & " " & [time]
    FROM yourtablenamehere


    BTW, name and time are reserved words in Access, so it would best not to use them as table or field names.

    Your second option is to leave your combo box as is and add two additional textbox controls to your form to display the information from the two additonal fields.

    When you add the textbox, set its control source property to the specific column of the combo box

    =YourComboBoxName.column(x)

    x= the number of the column of your combo box's row source; note that Access starts the counting a zero not 1.

    So if the combo's row source looks like this:

    SELECT ID, name, dob, time...

    and you want to display the dob in a textbox, the column number for dob would be 2.

  3. #3
    statty01 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    2
    Thank you for your reply,
    That is much clearer now!

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome. Glad to help.

  5. #5
    Parotina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    1

    I love you!

    I've been messing with this for days!


    Quote Originally Posted by jzwp11 View Post
    You have 2 options. The first option is to concatenate the three fields into one by using a query and then base the combo box on the query. The SQL text of the query would look like this. This will display the name followed by a space then the date of birth and then another space followed by the time

    SELECT [name] & " " & dob & " " & [time]
    FROM yourtablenamehere


    BTW, name and time are reserved words in Access, so it would best not to use them as table or field names.

    Your second option is to leave your combo box as is and add two additional textbox controls to your form to display the information from the two additonal fields.

    When you add the textbox, set its control source property to the specific column of the combo box

    =YourComboBoxName.column(x)

    x= the number of the column of your combo box's row source; note that Access starts the counting a zero not 1.

    So if the combo's row source looks like this:

    SELECT ID, name, dob, time...

    and you want to display the dob in a textbox, the column number for dob would be 2.

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'm glad my earlier post helped you out. Let us know if you have other questions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-10-2011, 12:25 AM
  2. combo box to search multiple fields
    By jo15765 in forum Forms
    Replies: 21
    Last Post: 12-23-2010, 03:28 PM
  3. Multiple fields in combo box
    By spqr in forum Forms
    Replies: 2
    Last Post: 10-07-2010, 06:52 AM
  4. Replies: 3
    Last Post: 09-29-2010, 09:31 AM
  5. Multiple Fields In One Combo Box.
    By caljohn527 in forum Forms
    Replies: 1
    Last Post: 02-20-2009, 03:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums