Just Once Through

The code below loops daily to check if a field (“Dodger”) no longer has “Open” listed in it. As long as “Open” is in it the code loops through daily. If I only wanted lines 4, 5 and 6 (an email function) to execute on the first loop how would I prevent the email from being sent on the second, third, fourth, etc. loops?

1 If doc.Dodger = “Open” Then

2 If AutoApprovedOF = “Yes” Then

3 Else

4 Print #17, “reci:Systems_Time@johnston.com

5 Print #17, “subj:Approval Required”

6 Print #17, “body:” firstname + " " + lastname +

7 Call CreateRollBack(“HoldStatus”, “NA”, “Hold Approval”)

8 Call CreateRollBack(“Dodger”, “man”, “Pending”)

9 End If

10 End If

Subject: Just Once Through

Dim flag as Boolean

Flag = False

If doc.Dodger(0) = “Open” Then

If AutoApprovedOF = "Yes" Then

Else

	If Not Flag then

		Print #17, "reci:System_Access@johnston.com"

		Print #17, "subj:Approval Required"		  

		Print #17, "body:" firstname + " " + lastname + 

		Flag = True

	End if

	Call CreateRollBack("HoldStatus", "NA", "Hold Approval")

	Call CreateRollBack("Dodger", "man", "Pending")

End If

End If

Subject: RE: Just Once Through

Thank you, Stephen! It’s a winner.