Email report by a form

G

gary

Hi,

I use this code to email the salary report to my colleague,

DoCmd.SendObject acReport, "salary", "HTML(*.html)",
Forms![main]!, "", "", "Salary Record", "Please reply!!", False, ""
DoCmd.GoToRecord acForm, "main", acNext, 1

but I need to click the button many times, I want to know,
how can atuomatic sent the report to the end of records by click the button
one time??

Thank!!
 
A

Al Campagna

Gary,
I see some errors in your syntax...
Look at Help under SendObject Method, and see the arguments that SendObject uses. Read
it carefully, and also see the example.

1. If Help says an argument is a string, use quotes on that.
2. If Help says an argument is an intrinsic value, no quotes are used.
3. You can leave an optional argument blank in the middle of the syntax, but you must
include the argument's comma. If you leave a trailing argument blank, don't use a comma
following the last argument you specify.
Don't put ("") in the place of an empty argument.
4. Your Format argument is wrong... "HTML(*.html)"... it should be the intrinsic value
acFormatHTML with no quotes.
--
hth
Al Campagna
Candia Computer Consulting
Microsoft Access MVP - Candia, NH USA
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

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