Hi,
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:
Below is how I am trying to avoid the error but receive a Microsoft VBScript compilation error '800a0414' Cannot use parentheses when calling a Sub
when the page opens:
Am I at all close to the correct this error message? or am I way of course?
Any suggestions is appreciated. Thanks
Tom
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:
Code:
<input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<%= FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) %>" />
when the page opens:
Code:
<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
Comment