Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormatCurrency Type Mismatch

Status
Not open for further replies.

sila

Technical User
Aug 8, 2003
76
GB
Hello can anyone help me. I am getting this error message below for the code following it (the whole line is line 473)

ERROR...

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'FormatCurrency'
/appcontracts/searchresults.asp, line 473

CODE....

<li> <%=(Recordset2.Fields.Item("Sub-Category2").Value)%>&nbsp;(<%response.write(FormatCurrency(Recordset2.Fields.Item("Min Value Agreed").Value,0))%>&nbsp;-&nbsp;<%response.write(FormatCurrency(Recordset2.Fields.Item("Max Value Agreed").Value,0))%>) <br>

Thanks
 
formatcurreny is not a built in vbscript function. You need to create one your self.
 
Note: I don't know what happens to my posting to a duplicated thread 329-852406. Must be deleted due to duplication.

Here is the reposting of my message.
Hello sila,

Formatcurrency() will throw a type-mismatch runtime if the expression is =null, or =empty, or empty string ="", or string not convertible to number such as ="$100" or ="abc123".

In your case, the way out is to control those item values befire passing to the response.write.

regards - tsuji
- tsuji
 
Thanks for your responses. tsuji,I got yours before it disappeared, thanks. We added IsNull to the code as it was struggling to bring back <NULL> value and it worked.

Cheers!
 
Hmm you learn something new everyday. If I only new that months ago, I could have save some agrevation :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top