Results 1 to 3 of 3
  1. #1
    George is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    295

    How to diaplay a string value from a control with lookup field type?

    Good morning All.

    My control data source is of lookup field type. The field being looked up is of string type but my output are numbers. How can I get the report to display the string values rather than numbers?


    Thank in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The query behind the lookup, if you need string, in the query, convert it to string: CStr([field])

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This is one of the reasons that the use of look up FIELDS are discouraged.
    I never use them.... They are a real PITA. And from what I can tell, no experienced programmer uses look up FIELDS.
    See http://access.mvps.org/access/lookupfields.htm

    If you have a form with a combo box that has the control source a look up field, you can try adding an unbound text box with the control source set to the name of the combo box and use the columns property.

    Example:
    The combo box is named "Combo9" (yeah, I didn't give it a proper name )
    The text box control source would be "=[Combo9].[column](0)" (No quotes)

    This is assuming that the PK field is the first field in the look up field.

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

Similar Threads

  1. Basic question on table design data type: lookup
    By drspanda@gmaill.com in forum Access
    Replies: 1
    Last Post: 07-17-2014, 07:56 PM
  2. Make subform control reference with a string
    By dcdimon in forum Programming
    Replies: 2
    Last Post: 04-01-2014, 02:24 PM
  3. Replies: 4
    Last Post: 06-30-2012, 02:01 AM
  4. Import to Excel from Access column of LOOKUP data type
    By Derek in forum Import/Export Data
    Replies: 1
    Last Post: 12-06-2010, 06:27 PM
  5. Using a string variable to specify a control
    By Gerry in forum Programming
    Replies: 3
    Last Post: 04-14-2010, 02:28 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