peterbowles
Registered User.
- Local time
- Today, 21:12
- Joined
- Oct 11, 2002
- Messages
- 163
hi
I am using this code
Private Sub Command10_Click()
Dim strEmail As String
Dim rst As Recordset
Dim strSQL As String
Set rst = Me.RecordsetClone
rst.MoveFirst
Do
If rst!SendMail = True Then
'Place all the email address into the TO: field
strEmail = rst.Fields("Email").Value
DoCmd.SendObject acSendNoObject, , , Me.Email
'Send EMail
strSQL = "UPDATE qryEmail SET SendMail = false "
'Set the field back to false
DoCmd.RunSQL strSQL
Me.Requery
End If
rst.MoveNext
Loop Until rst.EOF
End Sub
I want to be able to place all email address that have the SendMail chkbox = true into the TO: Field, then set the ckbox back to false.
The problem is that is does not put all the email address in the same TO: field it does a new message for each record. and the update will only update the selected record
Any help would be great thanks
I am using this code
Private Sub Command10_Click()
Dim strEmail As String
Dim rst As Recordset
Dim strSQL As String
Set rst = Me.RecordsetClone
rst.MoveFirst
Do
If rst!SendMail = True Then
'Place all the email address into the TO: field
strEmail = rst.Fields("Email").Value
DoCmd.SendObject acSendNoObject, , , Me.Email
'Send EMail
strSQL = "UPDATE qryEmail SET SendMail = false "
'Set the field back to false
DoCmd.RunSQL strSQL
Me.Requery
End If
rst.MoveNext
Loop Until rst.EOF
End Sub
I want to be able to place all email address that have the SendMail chkbox = true into the TO: Field, then set the ckbox back to false.
The problem is that is does not put all the email address in the same TO: field it does a new message for each record. and the update will only update the selected record
Any help would be great thanks