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

Email from Access with field name in subject 1

Status
Not open for further replies.

Garridon

Programmer
Mar 2, 2000
718
US
I have an email link on a form so that the user can email the control office with any questions about a specific record. I know that in web sites you can add text for the Subject line into the email link. Can this be done for the email link, using a field from the form, like for instance, a reference to the specific record number?

Linda Adams
Visit my web site for writing and Microsoft Word tips:
 
Linda

Yes this is possible - Instead of an e mail link use a command button on your form. Put code behind the command button to e mail the form.

Private Sub EMailYourForm_Click()
On Error GoTo Err_YourForm_Click

Dim stDocName As String

stDocName = "Your Form Here"
DoCmd.SendObject acForm, stDocName, acFormatHTML, , , , "Enter Subject Here"

Exit_EMailYourForm_Click:
Exit Sub

Err_EMailYourForm_Click:
MsgBox Err.Description
Resume Exit_EMailYourForm_Click

End Sub

If you want a different subject every time and want to pull it from a field in the form then replace "Enter Subject Here" with Me![YourForm][YourField]

It would also be possible to extract the e mail address of the recipient and also a CC address if you wanted a copy to an administrator etc. Just look up the SendObject properties in help for a detailed list of options.

Hope this helps

Blue Kestrel


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top