Macro not working right

M

martinmike2

Hello,
I have a SendObject macro that isn't working. Below is the code in
the "To:" line.

=Nz(DLookUp("[E-Mail Address]","Contacts","ID=" & Nz([Assigned To],
0)))

I have checked that the called fields are populated and they are.
However, when I run the query, the To: line isn't filled.
 
J

John W. Vinson

Hello,
I have a SendObject macro that isn't working. Below is the code in
the "To:" line.

=Nz(DLookUp("[E-Mail Address]","Contacts","ID=" & Nz([Assigned To],
0)))

I have checked that the called fields are populated and they are.
However, when I run the query, the To: line isn't filled.

It would of course be filled with a 0 if the Assigned To field is NULL. What
is the value of Assigned To? What is the datatype of ID? Is E-Mail Address in
fact a text field containing a valid email address for the contact?

I would suspect that you would do better to just set the to line to [E-Mail
Address] and use a criterion of IS NOT NULL on the email address field - since
there's very little point in doing a sendobject to a nonexistant email
address!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top