Is there a way to store code/SQL in a table, and reference it using a DLookup()? I made a limited attempt at it when I was trying to develop an e-mail. My thought was to dump the body, header, footer, subject, etc. in a table, and just reference the table when I wanted to send an e-mail. However, when I did that it came over as one big string, and didn't split out as expected (see below example).
Code:
'Where Field has the value of:
'"<body>This is a test for " & #" & Date & "# & ".</body>"
strBody = DLookup("Field", "Table", "[Field2] = 'Yes'")
The output in the email was quite literally
"<body>This is a test for #" & Date & "#.</body>"
Instead of the desired
"This is a test for 7/27/2011."
**Note In my actual code I was including the additional necessary HTML tags, but just omitted them for this example.