Results 1 to 5 of 5
  1. #1
    gkriff is offline Novice
    Windows 11 Office 365
    Join Date
    Apr 2023
    Posts
    3

    Multicolumn combo box


    I have a form with a combobox that I'd like to limit input. Before I can do that, I have to find a way to allow the user to see what the abbreviation in column 1 of the combobox dropdown table from column 2 of the table.

    Table combobox is based on:
    Spec SpecN Active
    HC Hoary Yes
    CT Canada Yes
    TEA Teas Yes

    Spec is short text (size 6). I inserted the SpecN column as short text (size 25). Active is Yes/No

    When I go to the form and select the property sheet, I change the column count to 2 and then column widths to 1";1" The resulting display is "Yes"
    If I change the column width to 0";1" the resulting display is "Yes"

    I haven't had to work with Access in a long time, so any help in getting "Hoary" to show up when a user scrolls through the dropdown to HC and "Canada" to display as the user scrolls past CT is appreciated. If there is something even simpler like a large tooltip listing all 32 rows when the user clicks on the dropdown, that wouldn't be optimal but could work too.

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Do you really need to display the Active value? If you include this field then ColumnCount is 3 and set ColumnWidths accordingly.

    If you want to save Spec value but allow user to type SpecN, Spec column width must be 0.

    Should you save Spec value or record ID?
    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
    gkriff is offline Novice
    Windows 11 Office 365
    Join Date
    Apr 2023
    Posts
    3
    I may be going about this the wrong way. I just need to have the SpecN somehow displayed as they scroll the list so they select the proper item from the Spec abbreviations in the dropdown. They've been adding items to the table because they assumed they knew what the abbreviations meant and I don't have room on my form (to fit the screen) to just use SpecN. I do not need the Active value displayed.

    I tried setting ColumnCount to 3 and set ColumnWidths to 1";1";0" and got this when clicking the dropdown:
    Click image for larger version. 

Name:	scnsht.jpg 
Views:	10 
Size:	5.2 KB 
ID:	50071Of course when I widen my control I can get close to what I want.


    Ignore the Species 2 field as it is below the Species 1 field I am working on. I would eventually change all these combo boxes to display the SpecN's if I can. Can I make this fit without enlarging my controls? I thought about trying a tooltip of the table, but it is 32 rows long and I don't know if Access can format a tooltip like a table (which would be a pretty huge tooltip)

    It's been a long time since I've had to code in Access and I did not create this database, so I am trying to keep things as simple as possible.

    Thank you

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    SELECT Spec, SpecN, Active FROM Specs;

    First visible field is the data that can be typed.

    BoundColumn is value saved into record.

    First column is usually a PK ID field and set as BoundColumn with 0 width which is then saved as FK in record. You want to save Spec value but allow user to type SpecN? Try: SELECT SpecN, Spec FROM Specs and set BoundColumn to Specs and no columns with 0 width.

    Width of Active field is irrelevant. Probably don't even need to include field in RowSource.



    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.

  5. #5
    gkriff is offline Novice
    Windows 11 Office 365
    Join Date
    Apr 2023
    Posts
    3
    Thanks so much for helping me along. I went ahead and adjusted the column width to 5" and it is producing exactly what I needed. I hoped this was simple, but I had searched forums where it seemed people were asking for the same thing and couldn't accomplish this:

    Click image for larger version. 

Name:	scnsht.jpg 
Views:	10 
Size:	32.0 KB 
ID:	50074

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

Similar Threads

  1. Multicolumn Combobox property issue
    By AmanKaur123 in forum Programming
    Replies: 7
    Last Post: 05-04-2017, 10:43 AM
  2. multicolumn Combobox
    By SSUTTON in forum Forms
    Replies: 5
    Last Post: 04-02-2015, 02:33 PM
  3. Reversing rowsource order for a multicolumn listbox
    By wackywoo105 in forum Programming
    Replies: 6
    Last Post: 12-10-2014, 06:26 AM
  4. Replies: 2
    Last Post: 10-21-2014, 07:57 AM
  5. Replies: 3
    Last Post: 10-01-2011, 02:21 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