Type Mismatch errors !!

DanLotusNotes used Ask the Experts™
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"
msg = "Access Date"
End If
txtaccdate = ""
If Isdate(cadoc.AccessDeadline(0)) Then
txtaccdate = Str(cadoc.AccessDeadline(0))
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 )
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.



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 !


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