Drjdh
asked on
Trimming characters
I have a 2010 Microsoft Access database which has the following code that parses a text field:
"TROPONIN-I/CTNI <0.03 ng/mL"
The problem is that I get an error because there is no space between the "<" and the "0.03". I need to trim off the "<" somehow and return only "0.03"
Any help would be greatly appreciated!
"TROPONIN-I/CTNI <0.03 ng/mL"
s = Split(LabPaste, "TROPONIN-I/CTNI ")
If UBound(s) > 0 Then
strLab = Split(Trim(s(1)), " ")(0)
strLab2 = Split(Trim(s(1)), " ")(1)
If (strLab = "<" Or strLab = ">") Then
Text863 = strLab
Text657 = strLab2
Else
Text863 = ""
Text657 = strLab
End If
Else
End If
The problem is that I get an error because there is no space between the "<" and the "0.03". I need to trim off the "<" somehow and return only "0.03"
Any help would be greatly appreciated!
ASKER
I actually want to keep the "<" and place that in a field. In the above code, if "<" is present, then it is stored in control Text863.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This "InStr" function was the key to this one.
Replace(StringOrField, "<", "")
You're replaceing "<" with "" (empty/nothing)