Type mismatch

HI

I am getting a type mismatch on this code, but just dont know how to fix it, any help would be grate

I get the type mismatch at if trunc = 1 Then

Dim ns As New NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument, claimdoc As NotesDocument

Dim vw As NotesView

Dim JRs() As String, JRs2() As String',msgUnique() As String 





Set db = ns.GetDatabase("","......",False)

Set dc = db.AllDocuments

Set doc = dc.GetFirstDocument

’ Set vw = db.GetView(“ClaimsClosedArchived”)

msg=""

jr=0

Redim JRs(0) As String 

oldestDate=Cdat("1/1/2009")

newestDate=Cdat("1/1/1950")

While Not doc Is Nothing And i<200

	i=i+1

	Doevents		

	jobRef=doc.jobref(0) 

	If jobRef <> "" Then			

		If doc.Form(0) <> "Claim" Then

			cr=cr+1

’ Set claimdoc = vw.GetDocumentByKey(JobRef, True)

			trunc=Evaluate("@IsDocTruncated",doc)

			If  trunc = 1 Then 					

				tr=tr+1

				If doc.LastModified<oldestDate Then oldestDate=doc.Lastmodified

				If doc.LastModified>newestDate Then newestDate=doc.Lastmodified

				Redim Preserve JRs(jr) As String 

				jrs(jr)=jobref

				jr=jr+1					

			End If

		End If

	End If

	Set doc=dc.GetNextDocument(doc)

Wend

Subject: type mismatch

trunc is a variant at this point.

use

if trunc( 0) = 1 then

john

Subject: RE: type mismatch

Thanks heaps :slight_smile: