Results 1 to 8 of 8
  1. #1
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78

    Question Table and its query reflect the combo box ID equivalent, not the text result


    Whats the best way to show the text result of a combo box selection when displaying the information through a query? I notice the table is also reflecting only the numerical ID result of the selection so I'm not sure how to take this result and display it as a text result to the user.
    thx!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    Include the lookup source table in the query by joining on the PK/FK ID fields. This will make the associated text value available for display. Joining tables in query to make related info available is basic concept of relational database.
    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
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    I have various queries where I'm joining tables as well as junction tables for my many to many relationships. Still only displaying the number ID references though. My combo box and option group values are entered through value lists on a separate form. Maybe that's the issue? I'm missing a step somewhere or I have only the bound values selected and I need to disable it. I have the properties for those fields in the query also set to Text box in their lookup column, didn't seem to matter.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    Couldn't make sense out of any of that. You will have to provide more info about data structure. What is related to what? If you want to provide db, follow instructions at bottom of my post. Identify objects involved.
    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
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Ha. Ok, lemme give it another shot, I’m still a newb so please forgive the ignorance.
    I have a form with a few multivalue controls such as option groups and combo boxes where I’ve inputted the various choices(values) in the form itself, not a table, however those fields are bound to my main table. But when a selection is made, only the numeric ID is getting stored in my table, from what I can tell. If I had stored these label choices in a separate table as unique fields I suppose then including those tables in a query would solve my problem? Before I go and change my db design a bit, is there a way to programmatically display the text value of these control choices instead of the corresponding numbers?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,643
    An expression in query, like:

    SELECT *, Choose([fieldname], 0, "this value", 1, "this value", 2, "this value") AS SomeName FROM table;

    Search Access Help/Web for more info on IIf(), Switch(), Choose() functions and creating fields in query with expressions.
    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.

  7. #7
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Will try that. Many thanks.

  8. #8
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Thanks again, the Switch() function worked. I'll be using that a lot, need to remember to keep those table data types set to number though.

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

Similar Threads

  1. Replies: 9
    Last Post: 01-09-2014, 02:58 PM
  2. Replies: 8
    Last Post: 11-20-2013, 01:03 PM
  3. Ribbon Creator or equivalent result...
    By shane201980 in forum Programming
    Replies: 4
    Last Post: 10-30-2012, 05:32 PM
  4. Replies: 4
    Last Post: 07-17-2011, 06:07 PM
  5. Can't reflect changes table-forms
    By graciemora in forum Forms
    Replies: 10
    Last Post: 06-27-2010, 03:03 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