bricklebrit
Technical User
Hello,
I've cut together a short script to send automatic email messages from an order form in access (through Outlook). It is:
Private Sub EmailThem_Click()
DoCmd.SendObject , , acFormatRTF, "example@email.com", , , "Hello, " _
& Me![CustomerNumber].Value, "Dear " & Me![CustomerNumber].Value _
& "," & vbCrLf & vbCrLf & "Thanks for your order. It will be shipped out right away to " _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & " " & Me![CustomerNumber].Value & " " & Me![CustomerNumber].Value _
& " " & vbCrLf & vbCrLf _
& "Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thanks." & vbCrLf, False
End Sub
I would like to replace the "example@email.com" with the looked up value of customer's email address which doesn't exist on this form, but would be on the table [Customers].
Do I need to run a dynamic lookup to obtain thsi email address or is there another function I can use to access this?
Thanks in advance for any help!
I've cut together a short script to send automatic email messages from an order form in access (through Outlook). It is:
Private Sub EmailThem_Click()
DoCmd.SendObject , , acFormatRTF, "example@email.com", , , "Hello, " _
& Me![CustomerNumber].Value, "Dear " & Me![CustomerNumber].Value _
& "," & vbCrLf & vbCrLf & "Thanks for your order. It will be shipped out right away to " _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & vbCrLf _
& " " & Me![CustomerNumber].Value & " " & Me![CustomerNumber].Value & " " & Me![CustomerNumber].Value _
& " " & vbCrLf & vbCrLf _
& "Please let me know if you have any questions." & vbCrLf & vbCrLf & "Thanks." & vbCrLf, False
End Sub
I would like to replace the "example@email.com" with the looked up value of customer's email address which doesn't exist on this form, but would be on the table [Customers].
Do I need to run a dynamic lookup to obtain thsi email address or is there another function I can use to access this?
Thanks in advance for any help!