How to stop email from being sent 2nd time when box is checked

Hello,

I have an agent that loops through a view checking for a date. If the date is equal to today it sends an email.

My problem is that when it finds the date it puts check in a checkbox to show it has been sent. But if the agent runs again it still sends an email although the box is checked.

I am trying to use the code below to stop it from sending another email, but it is not working. I put it right before the line that sends the email. Can someone help me out.

Thanks in advance.

'This updates the status field to stop the email going again

	doc.status="Terminated"

	Call doc.save(True,True)

Subject: how are you getting your document list?

If you’re saving documents and not updating your NotesDocumentCollection or NotesViewEntryCollection, the updates are not going to be known to your agent.