View Full Version : Print a form record by clicking a button on form


YNWA
06-19-2009, 05:07 AM
Hi, I have a form set up, all working fine. Think my previous post may have been in the wrong section

Now I want to add a button to the form so you click the button and it sends the current form data via email to someones email address that would have to be entered manually in Outlook.

I have a table consisting of the following fields...

referenceID - gives each record entered a unique ID
Request From - text field to enter the persons name who sent the request
Date of Request - Date field to enter date you received the request
Request Area - Memo field but on form it is a combo box to select a specific area from another table.
Brief Summary of Request - Memo field to enter what the request was asking for
Lead Analyst - Text field but drop down box on form to select one employees name from
Date Response Sent - Date field to enter a date you responded to the request
Date for Completion - Date field that autocalculates a date 14 days on based on date response sent
Comment/Action Taken - Memo field to detail what action was done for the request
Date COmpleted - Date field to enter a date you completed the request.

Now I just want a simply button that the user of the form clicks, and it will pop up with an Outlook email message with all the details of the current form/record in, so the user can enter the email address of the person who sent the request and send it to them detailing their referenceID etc.. which is useful for them incase they have any queries etc...

Is this possible? Or a better way of doing things?

Basically I want to send a response to someones email address which includes all the details the user of the form enters.

Cheers
Will

Maranna
06-19-2009, 05:41 AM
Hi Will

The way I would do it is, print the data to pdf then send as an email attachment. I don't know if you can extract the data directly into an email. See attached.

Maranna

YNWA
06-19-2009, 05:56 AM
I can email and attachment by doing file, send to, email but this sends all the records as an image or html or txt files.

There is a way to get the button to run a email but unsure of code or method.

Poppa Smurf
06-20-2009, 05:01 AM
In your macro set the following

Action to SendObject
Object Type Report
Object Name the name of your report
Output Type to Snapshot Format

To view the output you will need Snapshot Viewer which should already be installed, if not it is available free from Microsoft.

YNWA
06-22-2009, 02:47 AM
Cheers for the macro, however this gives me a snap shot of all the entries. I just want a snap shot of the current record I am looking at.

So say record 4, email just that record, not everything else in the database.

Also it sends as email attachment, how do I get it so it is within the email itself, not an attachment?

Poppa Smurf
06-22-2009, 02:57 AM
I assume that you are using a report to send as an email.

From previous postings it appears that you nothing to select the record displayed on the screen. In the query used for the report you need to have in the criteria of the referenceID field [forms]![name of your form]![referenceID].

YNWA
06-22-2009, 03:52 AM
I assume that you are using a report to send as an email.

From previous postings it appears that you nothing to select the record displayed on the screen. In the query used for the report you need to have in the criteria of the referenceID field [forms]![name of your form]![referenceID].

Hi, yes I created a report based on the macro you showed me.

I do not have any queries, just a table.

Should I build a query?

Poppa Smurf
06-22-2009, 03:58 AM
I do not have any queries, just a table.

Should I build a query?


Yes, you need a query. Using a table as the record source for your report will give you ALL records regardless of the selection on your form. So you need a query to select the record in the table based on the selection on the form.

YNWA
06-22-2009, 04:07 AM
Yes, you need a query. Using a table as the record source for your report will give you ALL records regardless of the selection on your form. So you need a query to select the record in the table based on the selection on the form.

Cheers
I have done this now.

But is there a way of getting the image as the body of the email, so that is the message, instead of an attachment that needs opening?

Makes it easier for people to read it as an email message rather than having to open things, as some firewalls may obstruct this.

Poppa Smurf
06-22-2009, 11:51 AM
But is there a way of getting the image as the body of the email, so that is the message, instead of an attachment that needs opening?

Makes it easier for people to read it as an email message rather than having to open things, as some firewalls may obstruct this.

I do not know of a way for the above requirement. Using snapshot, the attachement is in a report format. I have not heard of any firewall blocking an email with a snapshot attachment. The file extension is filename.snp