Ok, so i am using this code (see below) to open up a new email message with all my listed clients e-mail addresses in the bcc field.
Pleblem is some of the clients do not have an email address so it comes up with an error.
How do i get Access to ignore these blank fields, where there are no email addresses entered and use the ones that are entered?
Code:
- Private Sub Command12_Click()
-
-
-
Dim cn As ADODB.Connection
-
Dim rs As ADODB.Recordset
-
Dim strEmail As String
-
-
Set cn = CurrentProject.Connection
-
Set rs = New ADODB.Recordset
-
-
rs.Open "CustomerT", cn
-
-
With rs
-
Do While Not .EOF
-
-
strEmail = strEmail & .Fields("Email") & ";"
-
.MoveNext
-
Loop
-
.Close
-
End With
-
-
-
On Error GoTo Err_Command12_Click
-
-
DoCmd.SendObject _
-
, _
-
, _
-
, _
-
, _
-
, _
-
("" & strEmail), _
-
, _
-
, _
-
True
-
-
Exit_Command12_Click:
-
Exit Sub
-
-
Err_Command12_Click:
-
MsgBox Err.Description
-
-
Resume Exit_Command12_Click
-
-
End Sub
Thanks