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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Access and Outlook - SENDING EMAILS!!!!!!

Status
Not open for further replies.

Cricker

Technical User
Sep 11, 2002
31
CA
I need MAJOR HELP!!!

I have a database set up with people's personal info and emails. I need to beable to do a search (ex - evryone who lives on a certain street) and send them an email.

Basically I need to be able to use a push button and then get all the emails that were found and place them in the CC: (is this the one u can't c everyone's email?).

So I'm looking for some code that will open Outlook and then place all the emails in the CC: field. I'm using Access 97 and Outlook 97 also.

Can anyone help me....

Thanks in advance...
 
I have this on the onclick event of a combo box choice. It uses the QueryDef. You have your query defined, just replace it below. Instead of a combo box you can eaisly put this on a button's click event. This automatically opens a blank email, with the email address in the Bcc field, if Outlook is open.

Private Sub cmboCampus_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rst As DAO.Recordset

Set db = CurrentDb
Set qdf = db.QueryDefs("Name of your query here")
qdf.Parameters(0) = _
Forms!frmInstructor!cmboCampus
Set rst = qdf.OpenRecordset

rst.MoveFirst

Do While rst.EOF = False
strEmail = strEmail & rst!Email & ";"
rst.MoveNext
Loop

DoCmd.SendObject acSendNoObject, , , , , strEmail, , , , True

rst.Close
qdf.Close
End Sub
 
ad2:
Thanks for the info. I'm having one prob though. This line i'm getting an error message -

qdf.Parameters(0) = _
Forms!FRM_Main!Command71

RUN TIME ERROR '3265'
Item not found in this collection

Do u have any idea how I can fix this??

cw
 
How can I seen an Access report in a Message I reply to from Outlook Express.
Can I control or access Outlook Express from Access. I know how to send using Access, but repling is the question here.

Thanks, LeeGr
 
Cricker,

I'm not sure of the error you are getting. You may need to add a reference library. On the design view of the form> open the code window> under the tools menu choose references> scrool thru the available list and check Microsoft DAO 3.6 Object library.

I hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top