CDO Email using Field On Form (1 Viewer)

fenhow

Registered User.
Local time
Yesterday, 18:50
Joined
Jul 21, 2004
Messages
599
Hi, I am using the basic CDO method to send an email from Access.
I was looking how to use a field on the active form to populate the .To and .TextBody fields in the CDO mod.

Can anyone help?

Thanks

With cdomsg
.To = *Trying to get this from the field To on my open form
.From = "CAM360Delinquent@cam-trucks.com"
'.Subject = "Purchase Order Alert - CAM360"
.Subject = "CAM360 Lease Payment Default"
.TextBody = "Message: " & SMSForm.Form("Message")
.Send
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:50
Joined
Aug 30, 2003
Messages
36,127
.To = Me.EmailAddressTextboxName
 

fenhow

Registered User.
Local time
Yesterday, 18:50
Joined
Jul 21, 2004
Messages
599
Thanks Paul, I get a Invalid use of Me keyword error on it.
?
Fen
 

fenhow

Registered User.
Local time
Yesterday, 18:50
Joined
Jul 21, 2004
Messages
599
Got it, Screen.ActiveForm was the answer.
Fen
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:50
Joined
Aug 30, 2003
Messages
36,127
Ah, you didn't mention this was not behind the form. ActiveForm would work in a function, though it would require the control names be consistent. I'd probably set up the function so the email address, etc was passed to it as parameters.
 

Users who are viewing this thread

Top Bottom