> Hi Rick well I still don't know what code to use for the email code
> and the code clean up still I don't have any clue on how to this can
> you give me a more info about this thanks
Access has a built in function calles SendObject() that will send an Email
using your default MAPI client (Outlook or Outlook Express for example).
Dim db as Database
Dim rs as Recordset
Dim ToVar as String
Set db = CurrentDb
Set rs = db.OpenRecordset("[Comple Projects Status]", dbOpenSnapshot)
Do Until rs.EOF
ToVar = ToVar & rs![e-mail] &";"
rs.MoveNext
Loop
DoCmd.SendObject acSendNoObject,,,ToVar,,,"Subject", "Message",True
rs.Close
Set rs = Nothing
Set db = Nothing

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
MacrossHunter77 - 22 Apr 2008 15:49 GMT
Hello Rick well I tried your way and it works but there is a problem i just
noticed that it will take all the email addresses in the field but the
duplicates email will send it again and again for for example if my name is
derick and I have 5 records the code will email me 5 times for each record
also I noticed that eah individual received the same report, and I really
don't need that I need a code that can email each individual their own
records at the same time I don't want to repeat the emails again and again do
you another code to filter this name please let me know thanks
>> Hi Rick well I still don't know what code to use for the email code
>> and the code clean up still I don't have any clue on how to this can
[quoted text clipped - 18 lines]
>Set rs = Nothing
>Set db = Nothing
Rick Brandt - 22 Apr 2008 19:22 GMT
> Hello Rick well I tried your way and it works but there is a problem
> i just noticed that it will take all the email addresses in the field
[quoted text clipped - 5 lines]
> to repeat the emails again and again do you another code to filter
> this name please let me know thanks
Modify your query to return only the email addresses and then use a DISTINCT
clause. That will eliminate any duplicates. For individual Emails you just
move SendObject inside of the loop and drop the variable...
Dim db as Database
Dim rs as Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("[Comple Projects Status]", dbOpenSnapshot)
Do Until rs.EOF
DoCmd.SendObject acSendNoObject,,,rs![e-mail],,,"Subject", "Message",True
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
The final True is what makes the message appear in an Outlook window so you
can send it manually. If don't need that then just change it to False. As
it is shown you will need to manually press send on each message.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com