title: Function which Removes Only Non-ASCII characters in a column in access table
body: <p>I have a access table and i am writing a <code>vba</code> code to remove <code>non-ascii</code> characters from the table, i have tried using below two functions </p>
  
  <pre><code>Public Function removeall(stringData As String) As String
      Dim letter As Integer
      Dim final As String
      Dim i As Integer
  
      For i = 1 To Len(stringData) 'loop thru each char in stringData
  
          letter = Asc(Mid(stringData, i, 1)) 'find the char and assign asc value
  
          Select Case letter 'Determine what type of char it is
              Case Is &lt; 91 And letter &gt; 64 'is an upper case char
                  final = final &amp; Chr(letter)
              Case Is &lt; 123 And letter &gt; 96 'is an lower case char
                  final = final &amp; Chr(letter)
              Case Is = 32  'is a space
                  final = final &amp; Chr(letter)
      End Select
  
      Next i
      removeall = final
  
      End Function
  </code></pre>
  
  <p>And also tried using below function </p>
  
  <pre><code>Public Function Clean(InString As String) As String
  '-- Returns only printable characters from InString
     Dim x As Integer
     For x = 1 To Len(InString)
        If Asc(Mid(InString, x, 1)) &gt; 31 And Asc(Mid(InString, x, 1)) &lt; 127 Then
           Clean = Clean &amp; Mid(InString, x, 1)
        End If
     Next x
  
  End Function
  </code></pre>
  
  <p>But the problem is : In <code>removeall function</code> it removes everything including <code>#</code> and <code>space</code> characters.. And In <code>Clean function</code> also removes <code>special characters</code> as well.</p>
  
  <p>I need a correct function which retains key board characters and removes all other characters</p>
  
  <p>Examples of strings in tables are :</p>
  
  <p>1) "ATTACHMENT FEEDING TUBE FITS 5-18 ºFR#   "</p>
  
  <p>2) "CATHETER FOLEY 3WAY SILI ELAST 20FR 30ML LATEXº"</p>
  
  <p>Any help would be greatly appreciated</p>
  
  <p>Output should be like</p>
  
  <p>1) "ATTACHMENT FEEDING TUBE FITS 5-18 FR"</p>
  
  <p>2) "CATHETER FOLEY 3WAY SILI ELAST 20FR 30ML LATEX" </p>