SendObject arguments

M

Mike

Is it possible for the SendObject Method to take arguments
from an active form? If yes, then what the syntax should
be?
 
R

Roger Carlson

You really need to be more specific if you want an decent answer. For
instance, are you doing this from code? or a macro? I assume code because
you said "Method", but you never know. What kind of object are you sending?
What arguments do you want to send? Those would all be things we would need
to know to answer the question.

However, let's assume you want to send a report. The name of the report is
held in a textbox on a form. The form is called "MyForm" and the textbox is
"txtReport". Further, you want to email the report to a specific user whose
Email address is also held in a textbox called txtEmail. The syntax would
look something like this:

Dim theReport as String
Dim theUser as String

theReport = Forms!MyForm!txtReport
theUser = Forms!MyForm!txtUser

DoCmd.SendObject acReport, theReport, "RichTextFormat(*.rpt)", theUser, "",
"This is the Subject Line", "This is the body of the email", False, ""

On my website (www.rogersaccesslibrary.com) is a small sample database
called EmailingSpecificReports.mdb, which illustrates some of this.

--Roger Carlson
www.rogersaccesslibrary.com
 

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

Top