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

Send Info from a Single Form as an E-Mail Message or Attachment

Status
Not open for further replies.
Aug 29, 2001
151
US
Is there any way to have a user take the current record that is displayed on an Access form, and send the information on that record in an E-Mail. I am looking for this to be a manual process, where the user can save or copy the information and then send it in an e-mail. I do not care if it is an unformatted message (as long as the information can be read) or if it is an attachment (Word, excel or txt file, etc.)

I would like to do this without using Visual Basic code, if possible.

Thanks.
 
marchristensen,

Have a look at this...
onemiland said:
I use the code below to send Form data in an e-mail. What this will do is transfer the current data and place it in the message body...
Tek tips
Unfortunatly you will need VBA code[hairpull3] Also search this site!

I hope this helps...

Good Luck
 
The only way to do this is with code. Here's the code that will work. Make sure you have the latest Microsoft Outlook reference installed. The steps are:
1. Create an instance of an outlook object
2. Create a new message
3. Populate variables in the code with values from your controls on the form
4. Populate the email

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim To, Subject, Body as String

To = Me.txtTo
Subject = Me.txtSubject
Body = Me.txtBody

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

'***creates and sends email
With objEmail
.To = To
.Subject = Subject
.Body = Body
.Display
End With
End Sub

Changing ".Display" to ".Send" will automatically send the email.

HTH

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Thanks for the responses. I was hoping to find a process I could use with Access that did not involve coding. I will have to spend some time with this. Thanks again.
 
And what about this when the user has selected the record ?
menu File -> Send to ->

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I believe File -> Send to -> sends the ENTIRE table. I am interested in only sending the current record. Thanks, anyways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top