Macro for sending emails

czinker

Registered User.
Local time
Today, 12:36
Joined
Feb 26, 2015
Messages
19
I created a macro in a form to send a report based on a query. I'm looking for a way to auto populate the email address field in outlook based on the query.

Thanks
 
I don't use macros, but you can see if a DLookukp() in the address argument properly populates the address.
 
Would you use DLookukp() in a form or the query? I'm afraid if I put it in the Macro, it will just show "DLookukp()" as the email address
 
You're afraid it would, but didn't test? I did, it returned the email address.
 
I tested it but exactly what I thought happened. How did you test it?
 
With an = at the beginning. ;)
 
Happy to help and welcome to the site by the way!
 
Here's the problem I have now...

=DLookup("Due_Diligence_Email", "Docs Request", "Sheet1.ID = 1")

This is tied to form with a drop down box that gets the data from a query. If I have 1, then it only works for that 1 selection. How do I get it to just use the active record in the query?
 
Nevermind I got it!

=DLookUp("[Due_Diligence_Email]","Docs Request")
 
What you posted will return the first record found in the query. If that's not okay, you likely want the method in the link.
 
That's what I want, the first record in the query. All the drop down box does is populate the query with the selected info.
 
pbaldy,

Do you know how to ignore duplicates from a table and only show one record in a combo box?

Thanks
 

Attachments

  • Capture.PNG
    Capture.PNG
    2.1 KB · Views: 157
Normally I'd get the selections from a table that only had one record each, but you can use

SELECT DISTINCT FieldName
FROM TableName

or

SELECT FieldName
FROM TableName
GROUP BY FieldName
 

Users who are viewing this thread

Back
Top Bottom