We help IT Professionals succeed at work.

Invalid use of Null: 'cInt'

superabbe
superabbe asked
on
Medium Priority
812 Views
Last Modified: 2012-05-04
Recive that error on following line, code worked yesterday.

If cInt(intPreviousTicketNumber) <> cInt(intTicketNumber) Then

Have the variable intPreviousTicketNumber = 0 at the beginning of the code.
Comment
Watch Question

Commented:
superrabbe,

Try this:

IF intPreviousTicketNumber <> "" And intTicketNumber <> "" Then
If cInt(intPreviousTicketNumber) <> cInt(intTicketNumber) Then

End If
End IF

Regards,
Wee Siong

Commented:
Use: Cint("0" & intTicketNumber)

Commented:
before using your variable use isNull function.
in your example isNull(intTicketNumber)
what you can do is :
if isNull(intTicketNumber) then ...
OR
if Not isNull(intTicketNumber) then ...

Explore More ContentExplore courses, solutions, and other research materials related to this topic.