doran_doran
Registered User.
- Local time
- Today, 11:38
- Joined
- Aug 15, 2002
- Messages
- 349
I found following article from this forum. But where would I plug the code in my existing code.
http://www.access-programmers.co.uk/forums/showthread.php?t=30974&highlight=validate+e-mail+address
=== My Code ===
Private Sub cmdSendMail_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Recipients As String
Set db = currentdb()
'Set rst = db.OpenRecordset("tbltmpRecipients", dbOpenDynaset)
Set rst = db.OpenRecordset("Select * from tbltmpRecipients Where TotalRecipients Is Not Null", dbOpenDynaset)
If rst.EOF Then
MsgBox "You must populate at lease one e-mail address"
Exit Sub
Else
rst.MoveFirst
Recipients = rst.Fields("TotalRecipients")
rst.MoveNext
Do While Not rst.EOF
Recipients = Recipients & ", " & rst.Fields("totalrecipients")
rst.MoveNext
Loop
End If
Me.txtTotalRecipients = Recipients
rst.close
Set dbs = Nothing
Call SendNotesMailCOMVersion
End Sub
http://www.access-programmers.co.uk/forums/showthread.php?t=30974&highlight=validate+e-mail+address
=== My Code ===
Private Sub cmdSendMail_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim Recipients As String
Set db = currentdb()
'Set rst = db.OpenRecordset("tbltmpRecipients", dbOpenDynaset)
Set rst = db.OpenRecordset("Select * from tbltmpRecipients Where TotalRecipients Is Not Null", dbOpenDynaset)
If rst.EOF Then
MsgBox "You must populate at lease one e-mail address"
Exit Sub
Else
rst.MoveFirst
Recipients = rst.Fields("TotalRecipients")
rst.MoveNext
Do While Not rst.EOF
Recipients = Recipients & ", " & rst.Fields("totalrecipients")
rst.MoveNext
Loop
End If
Me.txtTotalRecipients = Recipients
rst.close
Set dbs = Nothing
Call SendNotesMailCOMVersion
End Sub