Hi All
I have been lurking for a while now and this forum has helped me enormously in getting to grips with access. Many thanks to all of you contributors.
Normally I can find the answers to any queries I have by searching this forum, in this case I am probably not asking the right question so I am hoping that someone can point me in the right direction.
I am using a command button to email an invoice to a customer using the sendobject function, whilst this almost works correctly it is adding an additional mailto:address along with the correct email address.
Example:
CorrectEmailAddress and then#mailto:CorrectEmailAddress
The code I am using is:
On Error Resume Next
Dim Cusemail As String
Cusemail = Nz(DLookup("Email", "invoiceemailQ", "orderID=" & OrderID), "")
If Cusemail = "" Then
MsgBox "No email Address"
Exit Sub
End If
Me.Refresh
DoCmd.SendObject acSendReport, "invoiceemailRpt", acFormatPDF, Cusemail, , , " Subject text", "Message Text"
If hasbeenemailed = False Then
hasbeenemailed = True
Else
hasbeenemailed = False
End If
If hasbeenemailed = True Then
hasbeenemailed = True
End If
I am still very new at this VB stuff and I am scratching my head on this one,
Can anyone see what I am doing wrong. Thanks for any help you can give.
Mark
I have been lurking for a while now and this forum has helped me enormously in getting to grips with access. Many thanks to all of you contributors.
Normally I can find the answers to any queries I have by searching this forum, in this case I am probably not asking the right question so I am hoping that someone can point me in the right direction.
I am using a command button to email an invoice to a customer using the sendobject function, whilst this almost works correctly it is adding an additional mailto:address along with the correct email address.
Example:
CorrectEmailAddress and then#mailto:CorrectEmailAddress
The code I am using is:
On Error Resume Next
Dim Cusemail As String
Cusemail = Nz(DLookup("Email", "invoiceemailQ", "orderID=" & OrderID), "")
If Cusemail = "" Then
MsgBox "No email Address"
Exit Sub
End If
Me.Refresh
DoCmd.SendObject acSendReport, "invoiceemailRpt", acFormatPDF, Cusemail, , , " Subject text", "Message Text"
If hasbeenemailed = False Then
hasbeenemailed = True
Else
hasbeenemailed = False
End If
If hasbeenemailed = True Then
hasbeenemailed = True
End If
I am still very new at this VB stuff and I am scratching my head on this one,
Can anyone see what I am doing wrong. Thanks for any help you can give.
Mark