Email question #2

NavyJoe

Board Regular
Joined
Sep 14, 2004
Messages
63
I have the form to set up to email me, but I want it to email the person who put in the trouble call, when I fill in my part of the form. I made an unbound field (Text17) and the code recognized it. i.e. When I pointed to it, a bubble came up and showed what I had entered into the field. I entered my email address again for testing purpose. So how can I get Access & Outlook to recognize that email address? Thanks.

In case you don't understand:

Table: Customer Service

Forms: Customer Trouble Call Log & Technician Repair Log

The fields in the code are:

Trouble Call Ticket
Username
Tech
Text17

Here is the code:

Private Sub Command20_Click()
Dim olApp As Object, olMail As Object
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "abc@xyz.mil" & Text17
.Subject = "Trouble Call Ticket" & Trouble_Call_Ticket_Number & "has been closed."
.Body = Username & vbCrLf & "Your trouble call ticket has been closed. If you have further information, please contact me." & vbCrLf & vbCrLf & "v/r" & Tech

.DeleteAfterSubmit = True
.Send
End With
Set olMail = Nothing
Set olApp = Nothing

End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Joe

What actual problem are you having?

Is it with this line?

Code:
.To = "abc@xyz.mil" & Text17

Which email address do you actually want to send to? abc@xyz.mil or the value in Text17? Or both?
 
Upvote 0
I got it. I had to add a semicolon after the email address in the code. So it looks like

.To = "abc@xyz.mil;" & Text17
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top