CDO Email using Field On Form

fenhow

Registered User.
Local time
Today, 09:18
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
 
.To = Me.EmailAddressTextboxName
 
Thanks Paul, I get a Invalid use of Me keyword error on it.
?
Fen
 
Got it, Screen.ActiveForm was the answer.
Fen
 
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

Back
Top Bottom