Results 1 to 2 of 2
  1. #1
    Shido151 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    16

    Combo Box Showing ID numbers instead of Names

    I have two tabels with a relationship/lookup. Lets say it's CityTbl and CustomerTbl, and the customerTbl has a City lookup/List field.



    I have a Customer Details Form based off the Customer Table but when I create a combo box to show a drop down list of the Cities to choose from, it displays the City Id number and not the City's name in the combo box.

    I found a way to correct this by creating a Query with the two tables combined, CustomerDetailsQry, then creating the form off the query and having the combo box's record source for cities be [CityTbl.City]

    However that doesn't work because now it's trying to replicate the cities in the CityTbl when I put in a new customer because the query is writting to the CityTbl directly and not to the CustomerTbl.

    Is there anyway to display the city names and not ID numbers?

  2. #2
    Shido151 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2012
    Posts
    16
    Already found my Answer and am going to post this in case cany one else gets caught up in this.

    It is showing the ID field but it's also showing the Names of the cities outside of your view. If you go to the combo box's properties and change column count to 2 and column widths to 1";1" and list width to .75 you can see how it's displaying both Id and Names but you can only see the names. Now change the column widths to 0";1" and Lsit Width to 1" and you'll see only the names.

    Now there's one more thing you have to do in order to get a nice neat list with no repeats and that is make the list source come from the Parent table which contains the look up, in my case CityTbl even though my form is coming from and writting back to CustomerTbl.

    you do this by writting in the Row source

    SELECT [CityTbl].[ID], [Citytbl].[CityName] FROM CityTbl ORDER BY [CityName]

    or

    SELECT [Table that has the list].[the ID field], [Table that has the list].[Column containing the list] FROM Table that has the list ORDER BY [Column containing the list]

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

Similar Threads

  1. Query returning numbers instead of Names
    By BigMac4 in forum Queries
    Replies: 5
    Last Post: 09-14-2012, 04:24 PM
  2. Changing names to ID numbers
    By marksnwv1957 in forum Access
    Replies: 4
    Last Post: 08-28-2012, 03:47 PM
  3. Replies: 3
    Last Post: 06-29-2012, 01:33 AM
  4. Names not Numbers
    By leeli67 in forum Database Design
    Replies: 12
    Last Post: 02-27-2012, 11:42 AM
  5. Report not showing all the names
    By tabbycat1234 in forum Reports
    Replies: 2
    Last Post: 11-26-2011, 07:14 AM

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