title: Remove duplicate text in string Function
body: <p>I have a function to remove duplicate text strings in a single column of an Access table:</p>
  
  <p>Original values:  Cardholder, Reconciler, Reconciler, Cardholder, Approver</p>
  
  <p>Desired output: Cardholder, Reconciler, Approver.</p>
  
  <p>I have the following function that accomplishes that, but it leaves a hanging comma if there is only one value to return (e.g. "Cardholder, ")</p>
  
  <pre><code>Function stringOfUniques(inputString As String) As String
          Dim inArray() As String
          Dim xVal As Variant
          Dim s As String
          inArray = Split(inputString, ",")
          For Each xVal In inArray
              If InStr(s, Trim(xVal)) = 0 Then _
              s = s &amp; Trim(xVal) &amp; " ,"
          Next xVal
          stringOfUniques = s
      End Function
  </code></pre>
  
  <p>What part should be adjusted to reflect that change?</p>
  
  <p>Thanks.</p>