Solved

Microsoft VBScript runtime (0x800A005E) Invalid use of Null: 'cdbl'

Posted on 2010-09-09
4
1,093 Views
Last Modified: 2012-06-21
Hi,

I receive the below error message on line 2 of the attached vb script code snippet:

Microsoft VBScript runtime (0x800A005E) Invalid use of Null: 'cdbl'

Do any experts know how I can fix this error? It only seems to flag now and again?

Thanks.
col_num = col_num + 1

col_sum(col_num) = col_sum(col_num) + sign * cdbl(itm.Value)

										if (sign * cdbl(itm.Value)) > 0 then

											fontcolor_st = ""

											fontcolor_et = ""

										else

											fontcolor_st = "<font color=red>"

											fontcolor_et = "</font>"

										end if

										Response.Write "<td class=s1d1_ce_r valign=top >" & fontcolor_st & GetYourFormat(sign * cdbl(itm.Value),number_format) & fontcolor_et & "</td>"

Open in new window

0
Comment
Question by:aspnet-scotland
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
VBClassicGuy earned 250 total points
Comment Utility
Maybe itm.Value sometimes is NULL? Might want to check for a valid value before executing the statement. Like:
If itm.Value <> Null Then
   col_sum(col_num) = col_sum(col_num) + sign * cdbl(itm.Value)
End If
0
 

Author Comment

by:aspnet-scotland
Comment Utility
I also get the error on the first line of the attached if you could help...
if (sign * cdbl(itm.Value)) > 0 then

											fontcolor_st = ""

											fontcolor_et = ""

										else

											fontcolor_st = "<font color=red>"

											fontcolor_et = "</font>"

										end if

Open in new window

0
 

Author Comment

by:aspnet-scotland
Comment Utility
I tried the attached but I still get the error?
if (sign * cdbl(itm.Value)) > 0 OR isNull(sign * cdbl(itm.Value)) then

											fontcolor_st = ""

											fontcolor_et = ""

										else

											fontcolor_st = "<font color=red>"

											fontcolor_et = "</font>"

										end if

Open in new window

0
 
LVL 14

Expert Comment

by:VBClassicGuy
Comment Utility
I think you have to do a check for "not null" on itm.Value all bu itself first, before you evaluate or do anything else. Just like my first example, make sure itm.Value is not null, then procede with your code.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now