Microsoft
Software
Hardware
Network
Question : Use a query result to populate recipients in SendObject
I have an Access function (I think I got it on Experts Exchange) that can concatenate line items from an Access table into a single string, separated by a common set of characters. I would like to use this function to create a list of email recipients that can be inserted into the recipients of a SendObject command. I've seen some similar solutions on EE but have not seen any that handles it this way.
I guess my question is, how do I refer to the results of a function and use the result in the SendObject command?
The query that produces the string of email addresses is:
SELECT DISTINCT concatrelated("[email]","[
child]","[
child].[pi
d]=" & parent.pid,"[email]","; ") AS Emails FROM Parent INNER JOIN Child ON Parent.PID = Child.PID;
The query result looks like:
[email protected]
;
[email protected]
;
[email protected]
Answer : Use a query result to populate recipients in SendObject
if the query is returning only one record
DoCmd.SendObject , , , dlookup("emails","sample")
_
, , "Sender", "Subject" _
, "Body of email." _
, 0, 0
Random Solutions
Multiple Asset tracking per month / Per year
Automatically update Org Chart when DB is updated
RAID config options for SQL Server 2008
Basic Form Question
Is there a way of reverting from Windows 7 back to Windows XP? I have a Windows.old folder that has saved all of the main Windows XP folders
PowerPoint Crashes on PasteSpecial DataType:=ppPasteOLEObect
How do I add some records in a query field?
Import a TXT file with >255 fields into Access 2003
ESXi 3.5 - 153875 - Two identicals network cards / only one working
Connectivity Problems between DC and Edge server in EBS domain