I am trying to email to a selected customer some data as an excel attachment.
The following routine creates the email and attachment but the address needs to be added manually.
The address is grabbed by this sql -
SELECT Customers.CustomerID, Customers.EmailAddress
FROM Customers
WHERE (((Customers.CustomerID)=[Forms]![Customersfrm]![CustomerID]) AND ((Customers.EmailAddress) Is Not Null));
How do I incorporate the address grabber in the function ?
TIA
David b
Function send_barcodes()
On Error GoTo send_barcodes_Err
DoCmd.SendObject acQuery, "findbarcode", "MicrosoftExcel(*.xls)", "", "", "", "Northumbrian Pedigree Bar Codes", "Enclosed as promised", False, ""
send_barcodes_Exit:
Exit Function
send_barcodes_Err:
MsgBox Error$
Resume send_barcodes_Exit
End Function
The following routine creates the email and attachment but the address needs to be added manually.
The address is grabbed by this sql -
SELECT Customers.CustomerID, Customers.EmailAddress
FROM Customers
WHERE (((Customers.CustomerID)=[Forms]![Customersfrm]![CustomerID]) AND ((Customers.EmailAddress) Is Not Null));
How do I incorporate the address grabber in the function ?
TIA
David b
Function send_barcodes()
On Error GoTo send_barcodes_Err
DoCmd.SendObject acQuery, "findbarcode", "MicrosoftExcel(*.xls)", "", "", "", "Northumbrian Pedigree Bar Codes", "Enclosed as promised", False, ""
send_barcodes_Exit:
Exit Function
send_barcodes_Err:
MsgBox Error$
Resume send_barcodes_Exit
End Function