I'm trying to build a list of e-mail addresses; however some of the fields are blank. If all the fields are filled in, no problem; however, if one of the fields is blank the process stops. I'm using the following code to cycle thru the records without success.
If rs.RecordCount > 0 Then
rs.MoveFirst
Do
If Not IsNull(rs!CCF_EMail) Then
vRecipientList = vRecipientList & rs!CCF_EMail & ";"
End If
If Not IsNull(rs!CC_Email) Then
vRecipientList2 = vRecipientList2 & rs!CC_Email & ";"
End If
If Not IsNull(rs!Chief_Email) Then
vRecipientList3 = vRecipientList3 & rs!Chief_Email & ";"
End If
rs.MoveNext
Loop Until rs.EOF
DoCmd.SendObject acSendReport, "rptNotification", acFormatPDF, vRecipientList2, vRecipientList3, , "PCS Orders Cannot be Published " & vbCr & vbCr & _
"Pending", "Sir/Ma'am," & vbCr & vbCr & "BLUF: Members from your unit, on the attached listing, blah blah", True
Else
If rs.RecordCount > 0 Then
rs.MoveFirst
Do
If Not IsNull(rs!CCF_EMail) Then
vRecipientList = vRecipientList & rs!CCF_EMail & ";"
End If
If Not IsNull(rs!CC_Email) Then
vRecipientList2 = vRecipientList2 & rs!CC_Email & ";"
End If
If Not IsNull(rs!Chief_Email) Then
vRecipientList3 = vRecipientList3 & rs!Chief_Email & ";"
End If
rs.MoveNext
Loop Until rs.EOF
DoCmd.SendObject acSendReport, "rptNotification", acFormatPDF, vRecipientList2, vRecipientList3, , "PCS Orders Cannot be Published " & vbCr & vbCr & _
"Pending", "Sir/Ma'am," & vbCr & vbCr & "BLUF: Members from your unit, on the attached listing, blah blah", True
Else