Results 1 to 2 of 2
  1. #1
    tatihulot is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    100

    How to Eliminate a Comma in Name Fields, if Field has Only One Name? i.e. Aerosmith, Cher, etc.

    Hello, I am using Access 2013 and have created a music inventory database.


    I have a question about formatting some text in a table. One of my tables has the following fields:

    tblArtist
    Artist ID
    DVD Number
    Artist Last Name
    Artist First Name
    Artist Full Name

    In my form, I want the artist's name to appear like this:

    Mozart, Wolfgang
    Dylan, Bob
    Beatles
    Aerosmith

    I know how to format the table to do this, and I know how to construct the form for this.

    To format the name, in the tblArtist table, I use the following expression in the Artist Full Name field:
    [Artist Last Name] & ", " & [Artist First Name]

    If an artist has only one name, such as Aerosmith, I enter it in the Artist Last Name column. Artists such as The Beatles or The Rolling Stones, I just omit "The."

    Here's the problem: When a one-name artist's full name appears in the form, there is a comma after their name. For example:

    Aerosmith,
    Beatles,

    Obviously, I'd want the field to appear like this, with no comma:

    Aerosmith
    Beatles


    My question is this: Is there a simple way to eliminate the comma if there is no text in the Artist First Name column? If so, what is the simplest, easiest, most practical novice-friendly way to do this?
    Thank you! TH

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try:
    Code:
    IIF([Artist First Name],[Artist Last Name] & ", " & [Artist First Name],[Artist Last Name])

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

Similar Threads

  1. Replies: 2
    Last Post: 08-14-2014, 04:00 PM
  2. Replies: 2
    Last Post: 11-11-2013, 10:09 AM
  3. Parsing A Comma Delimited Field
    By AccessGeek in forum Import/Export Data
    Replies: 6
    Last Post: 02-03-2011, 01:52 PM
  4. Replies: 4
    Last Post: 10-15-2010, 07:50 AM
  5. Replies: 15
    Last Post: 10-14-2010, 12:22 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