Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need "send mail" button on report toolbar

Status
Not open for further replies.

pduncan

IS-IT--Management
Jun 20, 2003
203
US
Can someone help me with coding this:

I would like to be able to open a report and have a custom button on the toolbar which when pressed would email the report (either as an attachment, or as the message body) to a person whose name (and email) is on the report (actually the name and email are part of the query that drives the report.)
 
If you go to view, toolbars, customize, and look at the commands under File, there should be 2 options, sent to mail recipient and send to mail recipient as attachment. If they are using Outlook, this should work well.

As for having the email go in automatically. You would probably need to write a module (record a macro to click on the mail recipient button that you want, and maybe even include doing the To.. part. )

From here you would need to use the code from the macro to customize the name/email field to = the outlook To field. Then you would go to your View, toolbars, customize, and set this macro to a button and to a toolbar ( which can just have this button) and then assign the toolbar to the report, so that it opens with it.

That's all I got!
hehehe


misscrf

Management is doing things right, leadership is doing the right things
 
how do I record a macro w/ Access 2003?

PDUNCAN - MEMPHIS, TN

When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
Good question.... I have 2002, so I will have to work on this queston from here...

I went to the macros in the database, went to create a new one, and saw that one of the commands is SendObject. I would try that, and just apply the macro to a button.

Let me know how testing goes, and if you need help in any area.

misscrf

Management is doing things right, leadership is doing the right things
 
I use 2002 at home - and have 2003 at work... but I dont remember even at home on A02 about seeing anything related to recording macros. If you can tell me how to record one on A02, i'll just do that tonight, then convert it to VBA - then I should be able to get it working here at work... I think.
 
Yes, you should be able to convert this to code once you get the macro "Created." As I understand it, you will not record the macro, but create one.

Open your database, and click on the Macros tab. Create a new macro, and name it something you will remember, I do not recommend using spaces. For the first action, using the drop-down box, choose SendTo. You will see in the read-only description, what that action is meant for. Then in the properties fields on the bottom left, for that action, fill them out according to your specifications. You might need to play with the properties.

Once you are done, go to the design of your report, go to view, toolbars, customize, then (no access on the computer I'm on!!! ahhhh) I wanted to check to make sure, but I think you will go to the last tab, to create a new button, and assign that macro to it. You then need to add this button to an existing toolbar, or create a new toolbar, and assign that toolbar to the report.

Let me know if you need some help.



misscrf

Management is doing things right, leadership is doing the right things
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top