Hi all,

I have the following piece of code that I'm tasked with maintaining:
Code:
<% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) 
    %>
  <tr> 
  <% If Len(Recordset1.Fields.Item("Term").Value)<2 Then 
		thi="0"&Recordset1.Fields.Item("Term").Value
	Else
		thi=Recordset1.Fields.Item("Term").Value
	End If 

	 If Len(Recordset1.Fields.Item("Sec").Value)<2 Then 
		sec="0"&Recordset1.Fields.Item("Sec").Value
	Else
		sec=Recordset1.Fields.Item("Sec").Value
	End If 

	%>
    <td>&nbsp;<%=Server.HTMLEncode(Recordset1.Fields.Item("Box").Value)%></td>
    <td>&nbsp;<%=Server.HTMLEncode(Recordset1.Fields.Item("Ter").Value&Sec&thi)%></td>
    <td>&nbsp;<%=Server.HTMLEncode(Recordset1.Fields.Item("VOL").Value)%></td> <!-- Error happens here. -->
    <td>&nbsp;<%=Server.HTMLEncode(Recordset1.Fields.Item("YEAR").Value)%></td>
    <td>&nbsp;<%=Server.HTMLEncode(Recordset1.Fields.Item("MISC").Value)%></td>
  </tr>
  <% 

'  response.write "the 1st digits are "&Cstr(Recordset1.Fields.Item("Ter").Value)&" and the second are "&Cstr(Recordset1.Fields.Item("sec").Value)&" and the third are "&Cstr(Recordset1.Fields.Item("Term").Value)&"<br>"
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend
%>
</table>
<% End If %>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
This is the error message that I'm getting:
[quote]
Now, when I run this script, this is the error message that I get:
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'HTMLEncode'

/misc/gorwood/defaultRx.asp, line 150
I'll be honest, I don't know VBscript or what is happening here.

If there is a more appropriate location for this post, please feel free to move it there.