Results 1 to 5 of 5
  1. #1
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215

    text string

    I have the following in a text box on a report and need help finishing it up.

    ="Dear" & " " & Trim([Account List.First Name]) & IIf([Account List.Account Type]="JTIC" Or [Account List.Account Type]="JTWROS" Or [Account List.Account Type]="JTENT",Trim([Account List.Joint Owner/Child First Name]),"") & ","

    I want it to look like this:
    Dear Joe,
    or
    Dear Joe & Jen

    I can't figure out how to add in the " & " infront of the second persons name.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Does this work?

    ="Dear " & Trim([Account List.First Name]) & IIf([Account List.Account Type]="JTIC" Or [Account List.Account Type]="JTWROS" Or [Account List.Account Type]="JTENT", " & " & Trim([Account List.Joint Owner/Child First Name]),"") & ","
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    First off, you don't need to include

    & " " &

    after the ="Dear" part. Just put a space after Dear:

    ="Dear " & Trim([Account...

    Second, you can just use

    "JTENT"," & " & Trim([Account...

    or use

    Chr(38) for an ampersand if you wish.

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    oops, I typed too slow this time

  5. #5
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    Thanks it works now.

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

Similar Threads

  1. Manipulating text string
    By genemd in forum Queries
    Replies: 4
    Last Post: 10-21-2011, 05:04 AM
  2. Can access take one text string and split it into two?
    By hobsondm01 in forum Database Design
    Replies: 2
    Last Post: 06-09-2011, 09:09 AM
  3. Breaking the string into Text / Number
    By Amerigo in forum Queries
    Replies: 15
    Last Post: 05-20-2011, 03:29 PM
  4. Replace a string/text in ms-access db
    By anziga in forum Queries
    Replies: 4
    Last Post: 12-31-2010, 06:40 PM
  5. Text string formatting
    By DanW in forum Forms
    Replies: 2
    Last Post: 11-02-2009, 11:11 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