Results 1 to 15 of 15
  1. #1
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7

    Combobox and bound column settings

    Good day all,



    I'm looking for a work around for getting the bound column setting for a combo box to work. I created a simple table with 2 fields that i have a combo box pointed to. My settings for the combo box are

    Column count 2
    Bound column 2

    The first field is "Description"
    The 2nd field is "ID"

    I cannot figure out how to have column 2 to be the value that is left in the combo box once I have made my selection.

    Any help would be more than greatly appreciated.


    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Most people have the ID as first column and hide it. You want to show it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Both values are "Left in" the combo box after you have made your selection. A VBA or macro reference to the combo box will retrieve the value of the bound column, and the combo box will display whatever column(s) you have told it to when you set the Column Widths property of the combo box.

    If the combo box is bound to a different table, with a rowsource in your simple table, then the bound column of the combo box determines what value is stored in the other table.

    If this is not the behavior that you are experiencing, please describe exactly what it IS doing, and we can help you figure out what settings need to be adjusted.

  4. #4
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    Thank you for posting so quickly,



    I could have done that, however when someone goes in and starts typing to do a lookup for a value, ideally they would find the description and not the ID, and after they make their selection, only the ID remains. That's why I like having the description as the first column.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Still don't understand. Do you WANT the ID to display in combobox?

    If not, try:

    RowSource: SELECT ID, Description FROM table;
    BoundColumn: 1
    ColumnCount: 2
    ColumnWidths: 0";2.0"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    After I click the drop down the list looks like this:

    Descrition ID
    First Unit 13001181
    Second Unit 13100113
    Third Unit 20001111
    4th Unit 20001452


    So that my individuals can click the combo box and start typing to find the description of the ID, I kept the description in the first column. And once they find the correct item, they make their selection and the ID is the only info that is left in the combo box.


    v/r,


    RabbidB

  7. #7
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    Thought I put this in the last reply;

    I do want the ID to be left in the combo box.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    My next question: Why have a cryptic number display instead of meaningful text?

    I suggest you have the combobox set up as I described. Then have an unbound textbox with an expression to display the number: =[comboboxname]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    I actually need both pieces of information displayed. The information is actually UNIT IDENTIFICATION CODES (UIC) for all military units throughout the world. I probably don't have all of them, but I have acquired most. For our database we need the specific UIC to go with the military unit description. In my database I have a text box where individuals can type in the unit name, and in this combo box they have the option of typing in the unit name in order to find the associated UIC. As in the previous reply, the UIC is a weird number. If I have column 1 set as the UIC, whenever someone clicks on the combo box and starts typing, they will not get very far unless they are familiar with the over 1300 different UICs. Everyone that will use this database is familiar with the units though and I'm hoping to make finding the UIC easier by finding the associated unit.

    Thinking about it now, I suppose I could make two different tables and hide one of the two columns that I do not need for each combo box.

    In the beginning when I started to change the settings of my combo boxes, I had thought it would be as easy as setting the column count to 2, and then setting the bound column to 1 or 2 depending on what value I wanted the database to display in the combo box.


    Thank you,


    v/r,

    RabbidB

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    My suggestion will display both pieces of information and allow typing the description.

    Why would two tables be helpful?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    The alternative is to have a combobox and a display-only text box. The afterupdate of the combobox sets the value of the text box. That way, both items can be displayed without interfering with the basic functionality of the combobox.

  12. #12
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    I'll try doing that. Can I have my combo box look up the units and UIC and after I make my selection, both columns be displayed in the combo box?





    Thank you

  13. #13
    RabbidB is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    7
    Dal Jeanis,


    This seems like a good idea.


    Thank you.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    There is no code required with the combobox and textbox approach. See post 8.

    If you want both values to show in the combobox, concatenate fields in the RowSource:

    SELECT ID, Description & " : " & ID AS Info FROM tablename;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Ah. June's right, RabbidB, use her way.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-24-2013, 05:14 PM
  2. Replies: 14
    Last Post: 12-15-2012, 02:59 AM
  3. Set value of bound combobox to NULL
    By Kotoca in forum Forms
    Replies: 1
    Last Post: 06-30-2012, 02:27 PM
  4. Replies: 1
    Last Post: 12-08-2011, 08:03 AM
  5. Bound form with bound combobox
    By Jerry8989 in forum Access
    Replies: 2
    Last Post: 12-05-2011, 01:50 PM

Tags for this Thread

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