Results 1 to 3 of 3
  1. #1
    MiniG is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    4

    Combobox with identical bound column ID

    In Access 2016, I have a combox with a list of Company Names and Company IDs. The Row Source of the combo box is:



    SELECT COMPANY_NAME AS [Company Name], COMPANY_ID AS ID FROM tbl_COMPANY;

    The bound column is COMPANY_ID, an integer. The COMPANY_NAME text is displayed in the combo box when a row is selected.

    Since a company can have multiple aliases (company reports under different names), I have duplicated COMPANY_ID (bound column).

    If a user selects a row for a case where its COMPANY_ID is also associated with one or multiple other rows, the text displayed in the combo box after it is selected is always the first COMPANY_NAME associated with the COMPANY_ID (bound column) found using the above SELECT (row source).

    I was wondering if there is a way to have the exact COMPANY_NAME text populated in the combobox after it is selected.

    As an example, If I have:

    BMW, 1222
    General Motors, 1223
    General Motors Corporation, 1223
    General Motors Inc., 1223
    GM, 1223
    Toyota, 1224

    And I click on General Motors Inc, General Motors will be the text displayed in the combobox, but I would want General Motors Inc.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    have a keyed table with unique ID
    General Motors, 1
    General Motors Corporation, 2
    General Motors Inc., 3
    GM, 4

    then another 'translate' table to get the real ID
    1, 1223
    2, 1223
    3, 1223
    4, 1223
    1224,1224

    then the user can pick the Name needed.
    to see only the name, and not the ID, hide the ID col via combo column lenghts.
    columnwidth: 3,0
    (name = 3", ID = 0")

  3. #3
    MiniG is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    4
    Thanks for the reply. I already have those unique ID (ALIAS_ID), so this solution won't be too hard to implement. The value I am interested in passing other forms is the COMPANY_ID. If I follow your logic, I believe instead of passing Me!comboCompany.Value, which would now be the ALIAS_ID, I could pass the COMPANY_ID with something like Me!comboCompany.Column(2).

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

Similar Threads

  1. Replies: 10
    Last Post: 03-16-2018, 08:26 AM
  2. Replies: 1
    Last Post: 01-16-2015, 09:28 AM
  3. Combobox blank when bound column hidden
    By dippim in forum Forms
    Replies: 2
    Last Post: 11-25-2014, 11:18 AM
  4. Combobox and bound column settings
    By RabbidB in forum Access
    Replies: 14
    Last Post: 11-21-2013, 02:39 PM
  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