Email Button

  • Thread starter Thread starter Kyle
  • Start date Start date
K

Kyle

In my form, I have a button name EmailPO. When user
click on this button, it is suppose to create a snap shot
of current record then open a new message window from MS
outlook express. Likely the user encountered this error
message "Microsoft Access cann't open the mail session".
The following is the On click event procedure code for the
button.

Private Sub cmdEmailCurrentPO_Click()
On Error GoTo Err_cmdEmailCurrentPO_Click

Dim stDocName As String

stDocName = "Purchase Order Form"

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acViewPreview, ,
"PurchaseOrderID=" & Me.PurchaseOrderID
DoCmd.SendObject acReport, stDocName, acFormatSNP

Exit_cmdEmailCurrentPO_Click:
Exit Sub

Err_cmdEmailCurrentPO_Click:
MsgBox Err.Description
Resume Exit_cmdEmailCurrentPO_Click

End Sub

Is there a file missing or corrupted? Is there away to
code the Event procedure so that it is open only specified
Email software. Any help to result this problem would be
appreciated.
 
Back
Top