To send email does it need to be on its own Command Button (1 Viewer)

patkeaveney

Registered User.
Local time
Today, 01:36
Joined
Oct 12, 2005
Messages
75
I have a private sub which i am trying to use to sends emails from a form

At the moment I call the sub from within an ON click event (On add New Button) when a user saves a record,.

Will this work, or does the code to send emails have to be on a button of its own. send email(On Click event).

I have posted the code on another thread,
this is just to find out if i can embed the email code or not.

Thanks

Pat
 

ted.martin

Registered User.
Local time
Today, 00:36
Joined
Sep 24, 2004
Messages
743
A button on its own is best
Private Sub cmdeMail1_Click()
On Error GoTo Err_cmdeMail1_Click
Dim strMail As String
strMail = [e-mail1] ' this is the text box with the e-mail address
cmdeMail1.HyperlinkAddress = "mailto:" + strMail
Exit_cmdeMail1_Click:
Exit Sub

Err_cmdeMail1_Click:
MsgBox Err.Description
Resume Exit_cmdeMail1_Click
End Sub
 

Users who are viewing this thread

Top Bottom