-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCleanText.bas
19 lines (16 loc) · 949 Bytes
/
CleanText.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Function Clean(txtClean As String)
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
'Function can be called from other modules of Access project
'Accepts string as param and removes invisible chars (spaces, tabs, etc)
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
txtClean = Replace(txtClean, vbLf, "")
txtClean = Replace(txtClean, vbTab, "")
txtClean = Replace(txtClean, vbCr, "")
txtClean = Replace(txtClean, vbCrLf, "")
txtClean = Replace(txtClean, vbNewLine, "")
txtClean = Replace(txtClean, Chr(160), "")
txtClean = Replace(txtClean, Chr(146), "")
txtClean = Replace(txtClean, Chr(39), "")
txtClean = Trim(txtClean)
Clean = txtClean
End Function