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

Email from a table

Status
Not open for further replies.

davman2002

Programmer
Nov 4, 2002
75
US
I want to know if anyone can help? I am using access 97. I want to create a module that will open a table that contains a column with email address. I want to send an email to the first person in the table and loop through the table sending an email to everyone listed. Can someone either show me how this can be done or direct me where I can find the answer. Thanks for all your help.
 
I am attempting a very similar feat and have worked out the rest of the equation using SendObject..I'm looking for the correct syntax to do a one record lookup based on a key field derived from another file. Any help would be greatly appreciated.
 
You both should look into recordsets in the help file. The examples will show you how to loop through a recordset. You'll be able to plug int he sendObject method to send the e-mails, just using a field from your recordset for the e-mail address parameter of SendObject.

When you get your code close to working, post back, with your code, and I'm sure we'll be able to sort it out for you.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Ok Need a little help with the Docmd statement.
Here is my test data

While not rst.oef
DoCmd.sendobject "","",rst("mgr"),rst("email")"","","","",false,""
rst.movenext
wend

Thanks
 
When you use a method with optional parameters, if you want to omit a parameter, you should have nothing between the commas, not "", so that's one thing to change here.

Another is that it seems like you've got your parameteres shifted a bit (you've got the output format listed as 'rst("mgr")').

Make a simple routine with just your docmd.sendobject statement in it. But don't cut and paste. And don't use a recordset, just use literal values for everything, and include a subject and some body text. That will make it easier to test, and to get to know the ins and outs of the sendObject method. Also, by typing it instead of cutting and pasting it, you will get to use intellisense, which will tell you which parameter goes after which comma.

Once you've got it going in the test routine, go back to the routine from which you've posted this snippet and paste in the working code from your test routine and then comment it out. Then, just below that line, type out the new one, replacing the literal values with references to your recordset.

Jeremy

=============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top