473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sending Email messages from Access.

Del
I have two question on sending email messages from MS Access (Versio
2000, 2002, and 2003). I have a form with a command button to send an
email message, the code behide the button is as follows;
================================================== ===========================

Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
strRecipient = "em**********@domain.com"
strSubject = "A New Vendor PO Has Been Entered, PO Number " &
Me![PO_Nbr]
strMessageBody = "This is to notify you that a new Vendor PO has
been entered." & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "PO Number " &
Me![PO_Nbr] & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "This Email has been
generated from the Vendor Repair PO Database, Please DO NOT reply."

DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject,
strMessageBody, False

================================================== ============================
This code work fine but I would like to expand it in two ways.

First:

The way this code sits now I have to hard code the email address, or
leave
it blank and let the user enter the email address. I don't want to do
either. I want to be able to pull the email address from a table. The
email address would be linked by the "BuyCode" field. The table has
the foloowing columns "BuyerCode" , "BuyerName" , "BuyerEmail" the
form hase a field called "Buyer" which is populated via a drop down by
the user. I want to be able to take the Buyer from the form link it
back to the table, pull the email address for that buyer and insert it
in the code above.
Second:

This database is used to alter the warehouse when a new Vendor Repair
Purchase Order has been entered into our main frame system. The code
above works fine if the Buyer is entering just one Vendor Repair PO.
There are time when a buyer may enter multiple Vendor Repair POs in
the same day. Rather than have the buyer enter each PO then email it
to the warehouse, I have created a form where the buyer can enter any
number of POs. What I would also like to do with the above code is
have is pull all the PO numbers on the "Multi Vendor PO" form and
insert them into the email body. The number of POs could range from 2
to 50 or more.

Thanks in advance for any input on either of these areas.

Regards,
Del
Nov 12 '05 #1
2 2061
dt****@yahoo.com (Del) wrote in message news:<c2**************************@posting.google. com>...
I have two question on sending email messages from MS Access (Versio
2000, 2002, and 2003). I have a form with a command button to send an
email message, the code behide the button is as follows;
================================================== ===========================

Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
strRecipient = "em**********@domain.com"
strSubject = "A New Vendor PO Has Been Entered, PO Number " &
Me![PO_Nbr]
strMessageBody = "This is to notify you that a new Vendor PO has
been entered." & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "PO Number " &
Me![PO_Nbr] & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "This Email has been
generated from the Vendor Repair PO Database, Please DO NOT reply."

DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject,
strMessageBody, False

================================================== ============================
This code work fine but I would like to expand it in two ways.

First:

The way this code sits now I have to hard code the email address, or
leave
it blank and let the user enter the email address. I don't want to do
either. I want to be able to pull the email address from a table. The
email address would be linked by the "BuyCode" field. The table has
the foloowing columns "BuyerCode" , "BuyerName" , "BuyerEmail" the
form hase a field called "Buyer" which is populated via a drop down by
the user. I want to be able to take the Buyer from the form link it
back to the table, pull the email address for that buyer and insert it
in the code above.


you could use DLookup to grab the e-mail address, or you could include
the e-mail address in the controlsource of your dropdown, and then
just reference the given column... something like

Me.cboBuyer.Columns(n)

where n is the (n-1)th column... (Column collections(?) are
zero-based) And just use that as your recipient address...
Nov 12 '05 #2
> Second:

This database is used to alter the warehouse when a new Vendor Repair
Purchase Order has been entered into our main frame system. The code
above works fine if the Buyer is entering just one Vendor Repair PO.
There are time when a buyer may enter multiple Vendor Repair POs in
the same day. Rather than have the buyer enter each PO then email it
to the warehouse, I have created a form where the buyer can enter any
number of POs. What I would also like to do with the above code is
have is pull all the PO numbers on the "Multi Vendor PO" form and
insert them into the email body. The number of POs could range from 2
to 50 or more.

Thanks in advance for any input on either of these areas.

Regards,
Del


use a query to return all the values you want, then loop through them,
concatentating what you want... see www.mvps.org/accessweb Look for
fConcatChild I think that's what you want.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
2
by: Deborah V. Gardner | last post by:
I am trying to send email from Access 2000 using Eudora. The MAPI option is set in Eudora to always be the MAPI server. When I use the Send option on the File menu I receive an message...
1
by: Devonish | last post by:
I am composing an email with Access VB and then sending it from within Access. Everything works correctly (the email actually goes!) but Outlook ask some irritating questions that the user is...
8
by: WindAndWaves | last post by:
Hi Gurus I am trying to send a newsletter from Access. Can anyone tell me what is the simplest way to send an email from Access? I would prefer not to use outlook, because this gives me all...
2
by: kimberly.shaffer | last post by:
Okay, I can automate sending of multiple emails with records using Groupwise and Access DB. But now what I need to do is send multiple fields associated with one field out automatically and can't...
0
by: Dragos Marian Barbu | last post by:
Recently I tried to develop a function to help me sending e-mail messages with more than one attachment. Everything is working OK when I am sebding messages with one attachment, but when I try to...
1
by: gemma.gill | last post by:
Hi There, I have a button on a form within access that sends a verification e- mail. My problem is that these e-mails are sending from individual user accounts rather than a genieric mailbox. ...
1
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the...
0
jackb
by: jackb | last post by:
Hi there. Is there any solution such that I could connect to some TAPI access number using TAPI in .NET, and then could send messages? E.g. consider SprintPCS; I could send message to any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.