coll.DeleteDocument not deleting the document

If localNab.IsOpen Then

While Not doc Is Nothing

	sF = "Form = 'Contact' & Type = 'Person' & @IsAvailable(ExpFromTD) & Certificate='" & telCertificate & "'"

	Set nabcoll = localNab.Search(sF,Nothing,0)

	Set nabdoc = nabcoll.GetFirstDocument

	If Not nabdoc Is Nothing Then

		Messagebox "Already exist"			

		Call nabcoll.DeleteDocument(nabdoc)  **  It displays the message “Already exist”, but it doesn’t delete it.  I have taken out the SetDOcValues, to check that it removes it, but it doesn’t **

	Else

		i = i + 1

		setDocValues localNab, doc

	End If	

	Set doc = coll.GetNextDocument(doc)

Wend		

prompt$=Cstr(i) & " document(s) were exported to your local address book.  Open local address book?"

	If ws.Prompt(PROMPT_YESNO, db.Title, prompt$) Then

		Call ws.OpenDatabase( "", nabfile)

	End If

Else

	msg$="Your local address book could not be found in the standard location.  Please contact the helpdesk."

	Msgbox msg$, 16, "Error"

End If

Subject: coll.DeleteDocument not deleting the document

You are deleting it from the collection NOT from the database!to delete it from the database you will have to call doc.remove

Subject: RE: coll.DeleteDocument not deleting the document

Duh (slap on forehead). Thanks Marjan, don’t know what I was thinking. Hmmm, can’t even blame it on being a Monday!?!?!?

Thanks again.