J
Jay
I have a form based on a query, with the text box txtEmailAddress
displaying the field EmailAddress from the source query. This textbox
(along with others) is then used to create an email in Outlook using:
Private Sub cmdOpenOutlook_Click()
On Error GoTo Error_Handler
Dim objOutlook As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.BodyFormat = olFormatRichText
.To = Me.txtEmailAddress
.CC = Me.txtCCEmailAddress
.Subject = Met.txtEmailSubject
.HTML = txt.MessageText
.Display
End With
That's not the whole procedure but you can see how the text boxes are
used to populate the relevant parts of the email.
My question is - How can I add a second email address to the .To ?
Also, the second email address I want to add is from a different query
to the one on which the form is based. I need to add
[qrySecondaryEmail].SecondaryEmailAddress. I can't figure out how to
display this field on the form or how to add it to the To.
ANY help greatly appreciated . . . . thanks, Jason
displaying the field EmailAddress from the source query. This textbox
(along with others) is then used to create an email in Outlook using:
Private Sub cmdOpenOutlook_Click()
On Error GoTo Error_Handler
Dim objOutlook As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.BodyFormat = olFormatRichText
.To = Me.txtEmailAddress
.CC = Me.txtCCEmailAddress
.Subject = Met.txtEmailSubject
.HTML = txt.MessageText
.Display
End With
That's not the whole procedure but you can see how the text boxes are
used to populate the relevant parts of the email.
My question is - How can I add a second email address to the .To ?
Also, the second email address I want to add is from a different query
to the one on which the form is based. I need to add
[qrySecondaryEmail].SecondaryEmailAddress. I can't figure out how to
display this field on the form or how to add it to the To.
ANY help greatly appreciated . . . . thanks, Jason