Hi:
I am having trouble with formatting a number field that has some null or blank values within the column. I'm using ASP in Dreamweaver MX and I have a field called 'Manpower_sum'. When I try to open an asp page for a record that contains a blank or null value in the 'Manpower_sum' field, I receive the following error message:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FormatNumber'
I am using the FormatNumber function for the line of code that is blowing up, when the field contains a null value.
My syntax for the code that keeps generating the error is:
<input name="Manpower" type="text" id="Manpower" value="<%= FormatNumber( rsGetAnnexData.Fields.Item("Manpower_sum").Value , 4, -2, -2, -1) %>">
What is the correct syntax if I want to adjust the statement above for null values, where if the field is null for the record I want it to leave it blank " " or default to a value of zero represented by the format 0.0000?
How do I incorporate the IsNull function into the statement above?
I tried doing something like:
<input name="Manpower" type="text" id="Manpower" value="<%=
If IsNull(FormatNumber( rsGetAnnexData.Fields.Item%("Manpower_sum").Value , 4, -2, -2, -1),0)%>">
But I don't think that is it.
Any help would be greatly appreciated.
Cheryl3D
I am having trouble with formatting a number field that has some null or blank values within the column. I'm using ASP in Dreamweaver MX and I have a field called 'Manpower_sum'. When I try to open an asp page for a record that contains a blank or null value in the 'Manpower_sum' field, I receive the following error message:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FormatNumber'
I am using the FormatNumber function for the line of code that is blowing up, when the field contains a null value.
My syntax for the code that keeps generating the error is:
<input name="Manpower" type="text" id="Manpower" value="<%= FormatNumber( rsGetAnnexData.Fields.Item("Manpower_sum").Value , 4, -2, -2, -1) %>">
What is the correct syntax if I want to adjust the statement above for null values, where if the field is null for the record I want it to leave it blank " " or default to a value of zero represented by the format 0.0000?
How do I incorporate the IsNull function into the statement above?
I tried doing something like:
<input name="Manpower" type="text" id="Manpower" value="<%=
If IsNull(FormatNumber( rsGetAnnexData.Fields.Item%("Manpower_sum").Value , 4, -2, -2, -1),0)%>">
But I don't think that is it.
Any help would be greatly appreciated.
Cheryl3D