Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to email to all "recipients" records in a table

Status
Not open for further replies.

hisham

IS-IT--Management
Nov 6, 2000
194
0
0
i have a table containe 150 names, i need to use all record of this table to send them one email by using sendobject action, i do all the job but i need the users can delete or add names to the table and the sendobject still email the resulte after users update? OR, how can users have access to TO argument?
 
Add another field called E-mail-Me and make it a Yes/No data type.
In this field if the person has recived and e-mial then put a check in it
Next time they need to E-mail people use a query that shows that field has a 0 or False

Here is a start of VBA code that will e-mail eqach person and put a true in the field so next time they won't be in the list:
--------------------------------
Public Sub EmailOnce()

Dim db As Database, rst As Recordset, SQL As String, a As Integer
Set db = CurrentDb
' SQL string.
SQL = "SELECT * FROM [yourTable] WHERE [E-mail-Me] = 0;"
Set rst = db.OpenRecordset(SQL)
rst.MoveLast
rst.MoveFirst
For a = 1 To rst.RecordCount
DoCmd.SendObject acSendNoObject, "", actext, rst![E-mail], , , "Subject goes here", "Message goes here", False
rst.Edit
rst![E-mail] = True
rst.MoveNext
Next

rst.Close
db.Close

End Sub
---------------------------

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Send me your email address and I have a database already setup that will do exactly what you want. All you'll need to do is modify the report to do what you want. I use this every month to send invoices to our clients. It sends out about 660 emails per hour. Dave.Harris@Ceridian.com
 
Dave,

If you don't mind, would you please send me the database because I need a sample for send invoices with email.
Thank you in advance
My email address : budijanto@indo.net.id
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top