When Owner's first name ends in an

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DZDS
    New Member
    • Aug 2013
    • 2

    When Owner's first name ends in an

    There is a field for first name and a field for last name. When the first name ends in an "s", the name should be displayed without an additional "s" after the apostrophe. How would I code this please?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use an IIf function call to check the last letter of the first name before appending the s after the apostrophe.

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      I would use:
      Code:
      Me.LastName = Replace(Me.Lastname,"'s","")
      So when there's a 's it's is always replaced by nothing.

      Nic;o)

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1293

        #4
        That should actually be
        Code:
        Me.FirstName = Me.Firstname & "'s" 
        Me.FirstName = Replace(Me.FirstName,"s's","s'")
        if the first name is in an object on the screen or report.

        DZDS, are you performing this in a query or a form or a report, or some other place? With a little more information we could help you more precisely. If this is enough information, please let us know.

        Jim
        Last edited by jimatqsi; Aug 23 '13, 11:00 PM. Reason: My first answer was only half right.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          Jimatqsi, very nice, reminds me of the old fortran/pascal solution I used on text file string manipulations.
          Last edited by NeoPa; Aug 25 '13, 01:50 PM. Reason: Separated out mod discussion.

          Comment

          • DZDS
            New Member
            • Aug 2013
            • 2

            #6
            This is for a report. Thank you.

            Comment

            Working...