473,321 Members | 1,708 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,321 software developers and data experts.

Help Sending Email - Access '97

Greetings! I am using Access '97 to track company orders. It's a pretty
basic setup featuring a main table (tbl_SalesSlip) and a related table
(tbl_ModelsSold). I would like to send an email that contains
information from both tables, but am unsure how to go about it. The
data is normalized. A sample of what I would like to send:

Data from tbl_SalesSlip
SalesSlipID
CustomerName
CustomerEmail
CustomerAddress
SaleDate

Data from tbl_ModelsSold
ModelNumber
SalePrice
SerialNumber

I would like to avoid attaching the information to the email as it's
created problems with customers not being able to open items in the
past. I'd really like to include a list of the model numbers in the
body of the email but am unsure as to how I should proceed.

I've played with sending emails in the past and have met with some
success. The following code is what I use to send a customer's receipt
(the receipt is attached).

-----------------------------------------------------------------------------------

Private Sub SendReceipt_Click()
On Error GoTo Err_SendReceipt_Click

Dim stDocName As String
Dim stCustEmail As Variant
Dim stText As String
Dim stSubject As String
Dim stCustEmail2 As Variant

stSubject = "Receipt from Camden TV and Appliance"
stDocName = "rpt_CustomerReceipt"
stCustEmail = DLookup("[email]", "tbl_Customers", "[CustomerID] = " &
Forms![frm_SalesSlip]!CustomerID)
stCustEmail2 = DLookup("[Email2]", "tbl_Customers", "[CustomerID] = " &
Forms![frm_SalesSlip]!CustomerID)

stText = "Greetings! " & Chr$(13) & Chr$(13) & _
"Thank you for your recent purchase via our online store. For your
convenience we have attached a copy of your receipt to this e-mail.
Included in the receipt is are links to any rebates you may be eligible
for. When applying for your rebates please print out two copies, one
for your records and to send along with the appropriate form. " &
Chr$(13) & Chr$(13) & _
"Please feel free to contact us with any questions or concerns!" &
Chr$(13)

DoCmd.SendObject acReport, stDocName, acFormatRTF, stCustEmail,
stCustEmail2, , stSubject, stText
Exit_SendReceipt_Click:
Exit Sub

Err_SendReceipt_Click:
MsgBox err.Description
Resume Exit_SendReceipt_Click

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

The part I don't understand is how I would insert the model numbers
into the above code. Should I use some sort of loop to insert the
models, do I need to approach this from a completely different angle,
am I an even bigger idiot than usual? Help :)

Nov 29 '06 #1
1 4741

Mose wrote:
Greetings! I am using Access '97 to track company orders. It's a pretty
basic setup featuring a main table (tbl_SalesSlip) and a related table
(tbl_ModelsSold). I would like to send an email that contains
information from both tables, but am unsure how to go about it. The
data is normalized. A sample of what I would like to send:

Data from tbl_SalesSlip
SalesSlipID
CustomerName
CustomerEmail
CustomerAddress
SaleDate

Data from tbl_ModelsSold
ModelNumber
SalePrice
SerialNumber

I would like to avoid attaching the information to the email as it's
created problems with customers not being able to open items in the
past. I'd really like to include a list of the model numbers in the
body of the email but am unsure as to how I should proceed.

I've played with sending emails in the past and have met with some
success. The following code is what I use to send a customer's receipt
(the receipt is attached).

-----------------------------------------------------------------------------------

Private Sub SendReceipt_Click()
On Error GoTo Err_SendReceipt_Click

Dim stDocName As String
Dim stCustEmail As Variant
Dim stText As String
Dim stSubject As String
Dim stCustEmail2 As Variant

stSubject = "Receipt from Camden TV and Appliance"
stDocName = "rpt_CustomerReceipt"
stCustEmail = DLookup("[email]", "tbl_Customers", "[CustomerID] = " &
Forms![frm_SalesSlip]!CustomerID)
stCustEmail2 = DLookup("[Email2]", "tbl_Customers", "[CustomerID] = " &
Forms![frm_SalesSlip]!CustomerID)

stText = "Greetings! " & Chr$(13) & Chr$(13) & _
"Thank you for your recent purchase via our online store. For your
convenience we have attached a copy of your receipt to this e-mail.
Included in the receipt is are links to any rebates you may be eligible
for. When applying for your rebates please print out two copies, one
for your records and to send along with the appropriate form. " &
Chr$(13) & Chr$(13) & _
"Please feel free to contact us with any questions or concerns!" &
Chr$(13)

DoCmd.SendObject acReport, stDocName, acFormatRTF, stCustEmail,
stCustEmail2, , stSubject, stText
Exit_SendReceipt_Click:
Exit Sub

Err_SendReceipt_Click:
MsgBox err.Description
Resume Exit_SendReceipt_Click

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

The part I don't understand is how I would insert the model numbers
into the above code. Should I use some sort of loop to insert the
models, do I need to approach this from a completely different angle,
am I an even bigger idiot than usual? Help :)
Create a RecordSet of model Nos an use that in the body of the email

Nov 30 '06 #2

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
4
by: David | last post by:
I'm wondering if python is capable of fairly precise timing and also sending data out the parallel port. For example ; making a 7.5 KHz square wave come out of one of the data pins on the...
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...
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...
7
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
6
by: \jason via DotNetMonster.com\ | last post by:
currently i am doing a personal website and keep on changing the aspect... finally the finall decision is to have a login page (requirement in asp.net, vb.net) and the login with security part of...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
2
by: ornto | last post by:
Hi, I'm trying to create an application which checks a dynamic web site and on certain events sends an email to me. My problem though is with the email task. By now I made this simple test code: ...
18
by: CenturionX | last post by:
Hello everybody, I'm using a webcontrol that gives me two probles: 1. I try to select an item in an html "select-one" control, i modify the value but it does nothing. When i navigate normally...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
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.