Results 1 to 10 of 10
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    display text box value like query

    i have a field in my table that is numbers representing different words like 1 is not ready, 2 is ready, 3 is done. using a text box on a continuous form can i display the text value instead of the numeric value? the values are entered previously using a value list in a combo box so there is no table to pull from.

  2. #2
    R. Hicks is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2016
    Location
    Birmingham, Alabama USA
    Posts
    3
    Several options ...
    I think I would use the Choose() function to do what you ask.
    Search the internet for this specific function for the correct syntax usage.

    R.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Normally a form would be bound to a query that has the two tables linked. Instead of choosing the field with the number (FKfield), add the field that is the description.

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks guys, yes steve the form is bound to a query but there is no table associated with the field since I was playing around with using a value list to input the values, just not sure exactly how display the text from the saved numeric values. not sure on the choose function, don't know anything about it.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So create a table with two fields, the first field has the same numbers, the second field has the text description.
    The number field must be the same type as the field in the main table.

    Link the two tables in the query. Voila





    not sure on the choose function,
    In a column in the query, it would be something like
    Code:
    GetStatus: Choose(TheField, "Not Ready", "Ready", "Done")
    Where
    1 is not ready,
    2 is ready,
    3 is done

    If "TheField" (change to your field name) is 3, the text displayed would be "Done".

  6. #6
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks Steve, i was playing with the idea of using the value list in the combo and eliminate another table being added to the DB. sounds like using the table is the best solution.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    "best" is matter of perception. If you want to be able to easily add more choices then a table is preferable. And if you don't want to have to build expression when needed. Otherwise, for such a small set of unchanging options, code is adequate.
    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.

  8. #8
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks June7, which code would you use, the choose function? would you have a example of its use?

  9. #9
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    here's what i have that is working.
    Code:
    Dim x As String
        x = Choose(StatusID, "Plan", "Parts", "Info", "RSched", "Sched", "InProg", "Comp", "Inter", "Deffer", "Closed")
        txtstatus = x

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    The options list a bit longer than I thought. But if you are happy with code approach, fine.
    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.

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

Similar Threads

  1. Text box to display value based on a query
    By ittechguy in forum Forms
    Replies: 4
    Last Post: 10-07-2015, 06:08 AM
  2. Replies: 1
    Last Post: 07-03-2014, 08:27 PM
  3. Replies: 1
    Last Post: 06-09-2014, 09:30 AM
  4. Replies: 9
    Last Post: 04-18-2014, 08:51 PM
  5. Replies: 3
    Last Post: 10-23-2009, 05:03 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