A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I send informatin from the database to a contact?



 
 
Thread Tools Display Modes
  #1  
Old May 8th, 2009, 07:43 PM posted to microsoft.public.access
bsyalniz
external usenet poster
 
Posts: 2
Default How do I send informatin from the database to a contact?

Trying to setup a button to send information from the database to a contact.

Ex. If a contact requests information that is contained in the database, I
want to be able to click on the contact in the database and it will send an
e-mail to the contact with the information they requested.
  #2  
Old May 8th, 2009, 07:52 PM posted to microsoft.public.access
BruceM[_4_]
external usenet poster
 
Posts: 558
Default How do I send informatin from the database to a contact?

Check Help for information about SendObject. You can add the appropriate
information to the subject line and/or the message body, as needed.
Presumably you are clicking on a button or text box or something on a form.
Is the contact e-mail address in the record from which you are clicking? If
so, add that to the To argument, then add to the other arguments as needed
for subject, message, and so forth, with commas as placeholders if you are
not using the argument. This may be clearer when you look at the Help file.
If you have further question, please provide specific information about such
things as how Access is to determine the e-mail address, and where it gets
the data to be included in the subject and/or message.

"bsyalniz" wrote in message
...
Trying to setup a button to send information from the database to a
contact.

Ex. If a contact requests information that is contained in the database, I
want to be able to click on the contact in the database and it will send
an
e-mail to the contact with the information they requested.



  #3  
Old May 8th, 2009, 08:09 PM posted to microsoft.public.access
Arvin Meyer MVP
external usenet poster
 
Posts: 640
Default How do I send informatin from the database to a contact?

"bsyalniz" wrote in message
...
Trying to setup a button to send information from the database to a
contact.

Ex. If a contact requests information that is contained in the database, I
want to be able to click on the contact in the database and it will send
an
e-mail to the contact with the information they requested.


Here's some of my code from my website:

http://www.datastrat.com/Code/OutlookEmail.txt

Notice the following line:

.body = "The body doesn't matter, just the attachment"

Instead change it to:

.body = Me.txtFirstName & " " & Me.txtLastName & vbCrLf & _
Me.txtAddress & vbCrLf & Me.txtCity & ", " & Me.txtState &
_
vbCrLf & vbCrLf & Me.txtPhone

substituting your control names, of course.

Private Sub Command0_Click()
'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

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

With objEmail
.To = "
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Test.htm"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

Exit_He
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

End Sub

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.