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

Fill subject line in Outlook with field value in Access

Status
Not open for further replies.

justagrunt

Technical User
Oct 10, 2002
132
0
0
Hi,
Basically what is needed when a Requisition is printed is an email sent with purchasing departments address and the Requisition number in the subject line.
The question is I can open the email hyperlink to the send to with the email address but what method do I need to add the PurchaseOrderNumber from the form into the subject line and send automatically. I have plagiarised an existing microsoft code and can get the email to open.
Private Sub EnableEmail()
' Update the Print button
On Error Resume Next
PrintForm.HyperlinkAddress = "mailto: " & "Email address here"

End Sub
Private Sub Message()
On Error GoTo HandleErr

' Save the record
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

' Make sure the hyperlink property is current
EnableEmail

' We don't actually have to do anything here. The button uses its own
' hyperlink property to send mail, as specified in the Form_Current

ExitHere:
Exit Sub

HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, _
, "Form_OrderNumbers.PrintForm_Click"
End Select
Resume ExitHere

End Sub

Cheers
Regards
Bill
 
This may help:
How to Email From Access using Outlook
faq702-2921
 
Have a look at the DoCmd.SendObject method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top