View Single Post
  #5 (permalink)  
Old May 20th, 2005, 05:10 PM
chipset chipset is offline
Authorized User
Join Date: Jul 2004
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via ICQ to chipset Send a message via MSN to chipset Send a message via Yahoo to chipset

why not write a function to perform the operation
for you
here is the one i have written;

Option Explicit
Const InvalideChar As String = "~`!@#$%^&*()_-+=|\{}[];':<>,.?/"

Private Function RemoveInvalideChar(Expression As String, _
                                sInvalideChar As String)

    Dim i As Integer            'counter
    Dim sChar As String         'hold single charater
    Dim iLenChar As Integer     'lenght of all character

    iLenChar = Len(sInvalideChar)
    For i = 1 To iLenChar
        sChar = Mid$(sInvalideChar, i, 1)
        Expression = Replace(Expression, sChar, vbNullString)
    Next i
    RemoveInvalideChar = Replace(Expression, Chr(34), vbNullString) ' chr(34) is "
End Function

hope it helps

Reply With Quote