dominicall
06-08-2003, 05:55 PM
When is a string not a string??? According to my replace function below when it is a string???
Can anyone see why on earth this is giving a type mismatch???
For i = 1 To Cols
'replace mm2 with superscript version
Dim mm2pos, columnhead2, columnheading
columnhead2 = CStr(Request.Form("columnhead")(i))
mm2pos = InStr(columnhead2,"mm2")
'debug
Response.Write columnhead2 & "<br>"
Response.Write mm2pos & "<br>"
If mm2pos > 0 Then
columnheading = Replace(columnhead2,"mm2","mm<sup>2</sup>", , ,vbTextCompare)
Else
columnheading = columnhead2
End If
... do some other stuff here...
Next
It's throwing the error on the replace statement... for reference, the value I entered in the appropriate field was Size (mm2).
Hope someone can see this.
Thanks
dominicall
Can anyone see why on earth this is giving a type mismatch???
For i = 1 To Cols
'replace mm2 with superscript version
Dim mm2pos, columnhead2, columnheading
columnhead2 = CStr(Request.Form("columnhead")(i))
mm2pos = InStr(columnhead2,"mm2")
'debug
Response.Write columnhead2 & "<br>"
Response.Write mm2pos & "<br>"
If mm2pos > 0 Then
columnheading = Replace(columnhead2,"mm2","mm<sup>2</sup>", , ,vbTextCompare)
Else
columnheading = columnhead2
End If
... do some other stuff here...
Next
It's throwing the error on the replace statement... for reference, the value I entered in the appropriate field was Size (mm2).
Hope someone can see this.
Thanks
dominicall