Hi,
Appreciate very much if someone can point out my mistake on the code sample below. What I am trying to do is to eliminate the "'" in front and at the back of the date string.

Kind regards



Public mtext As String

Private Sub Command1_Click()
Dim rDate As String
rDate = "'09/07/00'"
mtext = strip34(rDate)
msgbox(mtext) ' THIS MSGBOX RETURNED EMPTY STRING
End Sub

Private Function strip34(mStr As String)
Dim xCount%, iPos%
For xCount% = 1 To 2
iPos% = InStr(mStr, "'")
'Found at first position?
If iPos% = 1 Then
mStr = Mid(mStr, iPos% + 1, Len(Trim(mStr)))
Else
mStr = Mid(mStr, 1, iPos% - 1)
End If
Next xCount%
mtext = mStr
End Function