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

send an email - with autofill To:

Status
Not open for further replies.

Pampers

Technical User
Joined
Apr 7, 2004
Messages
1,300
Location
AN
Hi there,
I want to sent an email if you double click the control. I used the following code, which does the job. But what do I use in this line so that the emailaddress automatically appears in the email-handler To:-field?
Peter

Code:
Private Sub EmailAddress_DblClick(Cancel As Integer)
    DoCmd.SendObject , , acFormatHTML, , , , "Dammers"
End Sub
 
Put this bit of code in the on clic evend of a form which as text boxes

subject =subject of ur email
EmailBody = message text
email = emaill addesses

' code begins
Dim strEmailAddress As String
Dim strSubject As String

Dim strEMailMsg As String

strSubject = Me.subject
strEMailMsg = Me.EmailBody
strEmailAddress = Me.email


DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
, , strSubject, strEMailMsg, False, False

'code ends


hope this helps
jimmy
 
Code:
Private Sub EmailAddress_DblClick(Cancel As Integer)
    DoCmd.SendObject , , acFormatHTML, , , , "Dammers"
End Sub

Code:
Private Sub EmailAddress_DblClick(Cancel As Integer)
    DoCmd.SendObject , , acFormatHTML,"target@domain.com" , , , "Dammers"
End Sub

Does this not work?

James Goodman MCSE, MCDBA
 
Tnx for the replys!
Both solutions are working. And what is more, I found a 3th way.
Code:
Private Sub EmailAddress_DblClick(Cancel As Integer)
    DoCmd.SendObject , , acFormatHTML,EmailAddres.value , , , "Dammers"
End Sub

Returns the current emailaddress in the To: field.


Pampers.

You're never too young to learn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top