SendObject Macro

G

Guest

I'm trying to write a SendObject Macro that auto pouplates the To: Field from
a control.

This is what shows up in the Email To: Line.
[Forms]![Main]![EmployeeEmail]
 
R

Roger Carlson

Sorry, but macros cannot accept variables. In order to do this, you must
convert your Macro to Code. To do this, right-click on the macro name then
choose Save As. In the As box, choose Module. This will convert it to VB
code something like this:

DoCmd.SendObject acTable, "Table1", "RichTextFormat(*.rtf)", "xxx",
"xxxx", "xxxxx", "xxxxxx", "xxxxxx", False, ""

The x's represent the To, CC, BCC, Subject, and Message. This is where you
would put your variable:

DoCmd.SendObject acTable, "Table1", "RichTextFormat(*.rtf)", "
[Forms]![Main]![EmployeeEmail]", "xxxx", "xxxxx", "xxxxxx", "xxxxxx", False,
""


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
S

Steve Schapel

Mgiardina05

You need to precede it with a = sign.
=[Forms]![Main]![EmployeeEmail]
 

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