I am trying to display a field as currency from a recordset to a text field to my asp page. I am using FormatCurrency vbscript function. Everything works as designed if the field displayed contains a number. However, if the field is null, I receive a VBScript runtime error '800a000d.
Below is the code:
Expand|Select|Wrap|Line Numbers
- <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<%= FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) %>" />
when the page opens:
Expand|Select|Wrap|Line Numbers
- <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<% If IsNumeric (LastEacTotCapRs.Fields.Item("TotalCapEac").Value) Then FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) End If %>" />
Any suggestions is appreciated. Thanks
Tom