Type Mismatch errors !!

DanLotusNotes
DanLotusNotes used Ask the Experts™
on
Hello !!
This is a part my program. I got errors because I try to compare two date fields. Please help me if you know how to correct it. Thanks

Set rtitem = New NotesRichTextItem(superdoc, "Body2")
Set caview = db.GetView( "Misc Super" )
Set cadoc = caview.GetFirstDocument
While Not (cadoc Is Nothing)    
If cadoc.Form(0) = "AccCardResult" Then
If tmpcode = cadoc.code(0) Then
cc = cadoc.NumRepair(0)
If   Not  Isnumeric(cc) Then
cc = 0
End If

If cadoc.SelRepairAccessDates(0) = cadoc.AccessDeadline(0) Then msg = "Deadline"
Else
msg = "Access Date"
End If
txtaccdate = ""
If Isdate(cadoc.AccessDeadline(0)) Then
txtaccdate = Str(cadoc.AccessDeadline(0))
Else
txtaccdate = cadoc.AccessDeadline(0)
End If
Call rtitem.AppendText(     txtaccdate+" Apt: "+cadoc.AptNo(0)+" - "+cadoc.tenant(0)+", "+msg+" - "+Str(cc)+" Repair(s)")
Call rtitem.AddNewline( 1 )              
End If
End If
Set cadoc = caview.GetNextDocument( cadoc )
Wend    
         
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Which line causes you the problem ?

Type mismatch can occur if you compare different data types. Check your document closely and see if the date fields are available.

Basically it is a data problem.

~Hemanth

Author

Commented:
Thanks for your fast answer.


If cadoc.SelRepairAccessDates(0) = cadoc.AccessDeadline(0)

I think this line create an error, because when I remove, it works.  
DO you know any Syntax uses to check type of DATE.
NotesItem.Type would specify the data type of the field. Check help documentation !

Author

Commented:
Thanks for your help :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial