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

using a form to email

Status
Not open for further replies.

ironj32

Technical User
Dec 7, 2006
73
US
i am going to use a form (frmPropertyMngrInfo) which has PropMngrName, PropMngrEmail to insert an email address into my email program. I want to just click a command button to insert the address into the "To:" line. The problem I am having is inserting a different address for each record. I can get it to insert one address but i need it to insert the email value for each individual record. any thoughts?


Hyperlink Address mailto:???


Thanks!
 
Do you mean that you wish to send an email to each person in a list or that you wish to invoke the defaullt email program with code? If it is the second,

[tt]FollowHyperlink "MailTo:" & Me.EmailControl[/tt]

Should work.

If it is the first, you will find a variety of posts and at least one FAQ on the subject.
 
I did something like this in the past. Its code I got from this forum that I changed a bit. Create a table called “Send_Email_Status” Put the tables field in that are listed below. Activate the code from a macro… your good to go.



'------------------------------------------------------------
' Send_Emails1
'
'------------------------------------------------------------
Public Function Email_Program1()
On Error GoTo Send_Emails_Err
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim stTicketID As String '-- The ticket ID from form
Dim stWho As String '-- Reference to tblUsers
Dim stHelpDesk As String '-- Person who assigned ticket
Dim strSQL As String '-- Create SQL update statement
Dim errLoop As Error


varTo = DLookup("[Email_Address]", "Send_Email_Status") & ";jbleoo@matcor-matsu.com"
stSubject = "STATUS - Work Order #" & DLookup("[WO_Number]", "Send_Email_Status") & " " & DLookup("[Piority]", "Send_Email_Status")
'stText = DLookup("[WO_Status_description]", "Send_Email_Status" & vbCr & vbCr & DLookup("[LastOftime]", "Send_Email_Status") & vbCr & DLookup("[By_Who]", "Send_Email_Status") & vbCr & DLookup("[Status]", "Send_Email_Status"))

stText = DLookup("[WO_Status_description]", "Send_Email_Status") & vbCr & vbCr _
& DLookup("[LastOftime]", "Send_Email_Status") & vbCr _
& "Updated By : " & DLookup("[By_Who]", "Send_Email_Status") & vbCr _
& DLookup("[Status]", "Send_Email_Status") _
& ", " & DLookup("[Comment]", "Send_Email_Status") & vbCr & vbCr _
& DLookup("[More Details]", "Send_Email_Status") & vbCr _
& "Planned Completion Date is: " & DLookup("[Plan_Date]", "Send_Email_Status")



DoCmd.SetWarnings False
DoCmd.SendObject , , , varTo, , , stSubject, stText, False
DoCmd.SetWarnings True


Send_Emails_Exit:
Exit Function

Send_Emails_Err:
MsgBox Error$
Resume Send_Emails_Exit

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top