Sending Email based on several criterial

I have the following code that should send an email based on the following fields:

If note.DateCreated(0) > “[1/25/2007]” And _

note.RequestStatus(0) = “Complete” And _

note.Check8(0) <> “” Or note.Check9(0) <>“” Then

Call SendEquipmentNotification(note)

End If

Exit Sub

Well, I should say this is the last code I have tried…now it appears it is not sending email at all…Can someone help?

Subject: Sending Email based on several criterial

Is it even calling SendEquipmentNotifcation function?

Subject: RE: Sending Email based on several criterial

Because you are using ANDs and ORs, you may want to add some parenthesis to ensure the logic is evaluated in the correct order. Beyond that, we do not know what is in the subroutine.

Subject: RE: Sending Email based on several criterial

Ok, I have revised and thru some quick preliminary test the code below appears to be working. But, I need more testing.

If note.DateCreated(0) < “[1/25/2007]” Then Exit Sub

If note.RequestStatus(0) = “Complete” Then

If note.Check8(0) <> “” Or note.Check9(0) <>“” Then

Call SendEquipmentNotification(note)

Exit Sub

End If	

End If

End Sub

Subject: RE: Sending Email based on several criterial

I just ran it thru debugger with my changed code I posted and it is NOT calling the “SendEquipmentNotification.”

Subject: RE: Sending Email based on several criterial

Run it with debugger again and tell us where it pops out of your IF statements.

Subject: RE: Sending Email based on several criterial

Maybe explain what you’re trying to do…that is what is the IF statement is suppose to be doing. If the issue is the IF not calling the function then it’s a lot easier to solve.

Subject: Sending Email based on several criterial

how about

If note.DateCreated(0) > CDat(“1/25/2007”) And etc…