473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Users are getting Type Mismatch on 'Formatcurrency' when they scrolled to the bottom

The following lines of code return error message
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'FormatCurrency'
/UnetER/sam_CCMSamEditRules_Bottom.asp, line 51

When users scrolled down the bottom of a report written in ASP and running on Windows 7


Here is the lines of code:



Expand|Select|Wrap|Line Numbers
  1. <% if objRecordSet("IncorrectAmount") = 0 then %> 
  2.     <td align="right">*</td> 
  3. <%else%> 
  4.     <td align="right">
  5.         <%=formatcurrency(objRecordSet("IncorrectAmount"))%>*
  6.     </td> 
  7. <%end if%>
Aug 27 '13 #1
4 2578
Rabbit
12,516 Expert Mod 8TB
You probably have a null value. You need to decide how you want to handle nulls.
Aug 27 '13 #2
For nulls, I want to display blank. How do I get around that?
Aug 27 '13 #3
Rabbit
12,516 Expert Mod 8TB
Use an if structure.
Aug 27 '13 #4
Frinavale
9,735 Expert Mod 8TB
Just to elaborate, in VB, null is Nothing.

Your if structure should check for Nothing.

For example:
Expand|Select|Wrap|Line Numbers
  1. If myVariable Is Nothing Then
  2.   '...it is nothing
  3. End If
However, your code appears to be taking from a Record Set (based on your variable name). So you need may need to check if the value is DBNull using the IsDBNull Function.

For example
Expand|Select|Wrap|Line Numbers
  1. If IsDBNull(myVariable) Then
  2.   '... it is null/nothing
  3. End If
Sep 5 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Nicolas Verhaeghe | last post by:
I have designed an application which uses the Crystal Reports 8.5 ActiveX to show a report as a PDF. The report is compiled from a SQL database populated through web forms programmed in ASP. ...
4
by: leslie_tighe | last post by:
Hello, I have a method on a com+ object that is returning an array of objects. I know the array is popluated as calls to check the ubound and lbound show valid values. However, any calls to...
19
by: sara | last post by:
I am getting "Type Mismatch Error" when the following code executes. I am trying to notify the user if she attempts to add a customer with the same FirstName, LastName, Address(line1) and City as...
1
by: webstuff | last post by:
Hi, I'm getting a 'Type mismatch' exception when calling the Word.Application.Documents.Open method when using the Office XP 2003 PIAs. the actual error is: ...
3
by: zarar | last post by:
Hi to everyon i have a problem plz help me when i filter a recordset by date in vb and ms access and enter the any date of month 04/2007 i get the error msg as type mismatch but i works for...
1
by: mstrjohn | last post by:
I am using access as the front end to a mysql database using linked tables. I have a table called dailytrx that has all the transactions, there are 2 fields that I am concerned with, a date and a...
3
by: martin DH | last post by:
I would definitely appreciate any help with this problem as soon as possible. Thanks! I have a report that should display the results of a query based on two tables (tblClient and tblResult,...
2
by: dstorms | last post by:
Hi, I am trying to write code that opens a form using data highlighted from a listbox, but I keep getting Type Mismatch errors. I finally ran a test code and still got the error message. Dim...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
2
by: James Blue | last post by:
Dim m_MeetingName, m_City, m_title As String Dim m_sql As Long Dim dbs As Database, rst, rst2 As Recordset Set dbs = CurrentDb Set rst = dbs.OpenRecordset("Related Conference Categories",...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.