Send an active form as an email attachment

Mechele

Registered User.
Local time
Today, 23:39
Joined
Jan 25, 2002
Messages
121
How can I send an email with the attached document being an active access form with one record of data displayed?

I would like for the user to key in data in a form and then click on a command key to send an email notice. I would like the email notice to have an attachament the receiver can click on the see the data displayed in the form similar to the one used in access.

I've tried the docmd.sendobject code. It just sends a one line table as an attachment. I used the .rtf file extension, html file extension and the .txt file extension. The results are the same. It would be nice if the word application would open and you see the form with data on a word document......
 
Last edited:
If you really want all the formatting, you will probably need to use a mailmerge to export the current data to a mailmerge document in word and send that. The other option is using the snapshot format of teh report but this requires the other user having the snapshot viewer.
 
I'm Stumped!!

How do I make the report only show the current record? I only want to send the current record as it is generated.

Could you please help?
 
look at the openreport method, specifically the where arguments. I cannot remember the exact syntax (and cannot check it as this PC does not have Access) but it goes something like

Docmd.openreport "ReportName",acViewNormal,,"[YourIDField] = " & Forms!NameOfForm!IDField

hth
 
Thanks Fizzio,

I tried that and it does open my report but it shows all records and not the current form.

this is code I put in

strcriterion = "[workorder] = " & Me![WorkOrder]

DoCmd.OpenReport "rptNewWorkOrder", acViewPreview, , strcriterion

when I hover my mouse over the strcriterion in the docmd line it gives me the correct workorder number that I am trying to print
but it asks for a workorder parameter...

Can you give me some ideas?
 
Last edited:
Noreen,

Just an idea, I just completed an app that does exactly what your trying, although mine sends the report as a rtf attachment, and the report data is also in the email message body, taken from the form.

The report is based on a paramter query. I have the value passing go to a query first and then the form will attach the report.

HTH
 
Please could I use your code or would you tell me exactly what I need to do?

I would deeply appreciate it..That sounds like exactly what I need.

Thanks, Noreene
 
Noreen,

The app is in Access 2002. But the code would be the same.

I have another project I'm working on that I attached to another post. The code for the print to an email is the same. It just doesn't attach a report.

Look for a post in the 'Forms' forum, and search for "vbCrLf in a string". The attachment is near the bottom. This one is in Access 97.

One thing I found better, for this particular app, was to have all the data I want to send, in the form. I populate the fields and then send. The other app draws info from other tables for the report. That's why I based the report on a query.

Take a look and let me know if I can be of any assistance.
Like to try and pay back on the help, I've asked so much of this forum.

Bob
 
If workorder is formatted as text, not a number, the code would be

strcriterion = "[workorder] = '" & Me![WorkOrder] & "'"

but also [workorder] must be a field in the recordset supplying the report.
 
Thanks Bob, I have downloaded your app and it will certainly help me...This forum has certainly been a life saver for me, too...

Fizzio,

Even when I put in your code, it still asks for a workorder parameter value......WHY!!!!!

Of course, when I just click OK it trys to print all records.
 
Not sure about this, but your form with the parameter criteria needs to be open in order for the value to be passed to the query. If it's not passed then it should print all the reports, and not the one you want printed because the value was never passed to the query.

Hope this didn't confuse you.
 

Users who are viewing this thread

Back
Top Bottom