I'm stuck again with trying to modify some code I'm borrowing from here... I'm trying to get Access send a message with the TO: address drawn from the field txtToEmail but that doesn't seem to be working...
The
[highlight].To = strEmail[/highlight]
Doesn't seem to be drawing the e-mail from field I want it to with this early bit
[highlight]strEmail = txtToEmail[/highlight]
I keep recieving a runtime error with a set of strange numbers and a message that reads "There must be at least on name or distribution list in the To, CC, or BCC box".
The debug highlights
[highlight].Send[/highlight]
I'm running Access 2002 and had an early problem with some references not being turned on, but I've activated both of the Outlook References for the system... Did I miss one?
Any suggestions, ideas, or places to look are much appriciated!
***************************************
Have a problem with my spelling or grammar? Please refer all complaints to my English teacher:
Ralphy "Me fail English? That's unpossible." Wiggum
Code:
Private Sub cmdEmailTrackingNumber1_Click()
Dim strEmail, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strEmail = txtToEmail
strBody = strBody & "Atraining package has been sent to you, please see the tracking number and description below for more details"
strBody = strBody & "Tracking Number: " & txtTrackingNumber1
strBody = strBody & "Description: " & txtTrackingNumber1Description
With objEmail
.To = strEmail
.Subject = "Training Shipment Tracking Information"
.Body = strBody
.Send
End With
Set objEmail = Nothing
Exit Sub
End Sub
[highlight].To = strEmail[/highlight]
Doesn't seem to be drawing the e-mail from field I want it to with this early bit
[highlight]strEmail = txtToEmail[/highlight]
I keep recieving a runtime error with a set of strange numbers and a message that reads "There must be at least on name or distribution list in the To, CC, or BCC box".
The debug highlights
[highlight].Send[/highlight]
I'm running Access 2002 and had an early problem with some references not being turned on, but I've activated both of the Outlook References for the system... Did I miss one?
Any suggestions, ideas, or places to look are much appriciated!
***************************************
Have a problem with my spelling or grammar? Please refer all complaints to my English teacher:
Ralphy "Me fail English? That's unpossible." Wiggum