none
Displaying names from combo box instead of primary key value (along those lines) RRS feed

  • Question

  • I don't know how to adequately describe my issue, so bear with me.

    Let's say I use a combo box to display a person's name in a form. I use the Column Count and Widths tip to list the person's name and IC number. See the attached image below:

    The primary key (AutoNumber) is hidden

    If I try to display it elsewhere, in another form or a report, all that appears instead is a number, which I'm guessing corresponds to its autonumber ID. See image below:

    Refer to the highlighted box

    How do I ensure that the name displays in that other report or form? Is there a simple way to do it? Thanks.


    • Edited by calvynius92 Monday, June 13, 2016 8:21 AM Edited title
    Monday, June 13, 2016 8:20 AM

Answers

  • Hi calvynius92,

    you have asked a question, "Let's say I use a combo box to display a person's name in a form."

    First take a Combobox control and place it on the form.

    See the properties of the combobox.

    Find the Tab "Data" in properties.

    Then Find Row Source. in that select the table and select the field that you want to display in the combo box.

    try to run a form you will see your data are available in combobox.

    if you think that any of the suggestion given here helped you to solve your issue then I would recommend you to mark that suggestion as an Answer.

    if you still facing a problem regarding that then please let us know so that we can try to provide you further Assistance.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 14, 2016 2:13 AM
    Moderator

All replies

  • You need to set the Data Source for the field to the user name etc. instead of the ID number

    Best regards, George

    Monday, June 13, 2016 11:59 AM
  • When you build your report's Record Source, you need to add the related table and join it to your main data table to extract the associated name from the autoID.

    So right now you must have something very simple, probably a single table, something like:

    which produces something like:

    So you need to add the related table and join it, something like:

    and then you'd get


    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Monday, June 13, 2016 1:05 PM
  • DP's post gives you the advice on making a join if the text info field is not part of the record source.

    If the text info field is already part of the record source; control which field is viewed in a combo box or look up field by manipulating the field widths of property of the field.  You will see their widths side by side separate by commas i.e. 1",1", etc.      Change that to: 0",1"

    Monday, June 13, 2016 1:13 PM
  • Thanks Daniel. Can I ask about that little statement you made in the query design screenshot?

    "Employee: [FirstName] & " " & [LastName]"

    I'm guessing "Employee" refers to the T_Employee table? What about the operation that follows? Does it join the elements from the T_Employee table into the T_Projects table?

    I tried emulating your example, but I don't seem to be getting any results. I get a blank query. Is it because of a "bad" (for lack of a better term) join?

    Thanks for your help.


    • Edited by calvynius92 Tuesday, June 14, 2016 1:00 AM Edited content
    Tuesday, June 14, 2016 12:51 AM
  • Hi calvynius92,

    you have asked a question, "Let's say I use a combo box to display a person's name in a form."

    First take a Combobox control and place it on the form.

    See the properties of the combobox.

    Find the Tab "Data" in properties.

    Then Find Row Source. in that select the table and select the field that you want to display in the combo box.

    try to run a form you will see your data are available in combobox.

    if you think that any of the suggestion given here helped you to solve your issue then I would recommend you to mark that suggestion as an Answer.

    if you still facing a problem regarding that then please let us know so that we can try to provide you further Assistance.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 14, 2016 2:13 AM
    Moderator
  • Thanks Deepak, but my question is still unanswered, so I'll wait for a response that helps me with my issue before I mark an answer.
    Tuesday, June 14, 2016 2:21 AM
  • Employee:     is an alias, it will become the name of the field column, one can put anything there i.e.

    Full Name:

    this part: [FirstName] & " " & [LastName]

    is called a calculated value in a query - even though in this case it is not math - one is constructing a unique value by merging two existing fields.  T_employees is implied because these are uniquely named fields.  If other tables had the same field names you would need to append the table name to differentiate as to which field you are referring i.e.

    None of this has anything to do with the quantity of records that are returned by the query.  If no records result when you run the query it is probably due to the join line not finding a match in both tables.

    Tuesday, June 14, 2016 12:59 PM
  • Hi calvynius92,

    so here I think we misunderstood your question.

    can you try to clear what you want to achieve and what's your issue.

    we understand that you want to display name in combobox instead of autonumber value.

    if I understand something wrong then please correct me so that we can try to give you further suggestion.

    Regards

    Deepak 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 15, 2016 4:32 AM
    Moderator
  • Can you post your db or at the very least your query's SQL Statement

    Daniel Pineault, 2010-2012 Microsoft MVP
    http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, June 15, 2016 1:06 PM
  • Hi calvynius92,

    is your issue solved? did you got solution for your issue?

    in the original post your issue is related with combobox but you are now asking about merged fields.

    you did not gave any response for our last reply.

    if your issue is solved then would you like to share the solution with our community so that if any other member have same issue like you also get solution from your post.

    if your issue did not resolved till now please try to give a response and let us know so that we can try to give you further suggestions.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 21, 2016 6:51 AM
    Moderator