Create Email from MSAccess (1 Viewer)

brian006

New member
Local time
Today, 08:49
Joined
Sep 27, 2014
Messages
3
What I'm looking to do really doesn't seem that hard but I am really struggling. I have a MSACCESS 2007 form where a user enters data onto the form. I'd like for them to be able to click a button to run a code which will take some of the fields on the current form and open an outlook template and insert the fields in various places in the body, subject and to,cc, etc.

I've tried mailmerge modules and my information is really not a "mass" email it's just one simple email using the data the user just entered and inserting it into a template. I have an outlook template that I'd like to insert the field values into but it never works. I'm using MS ACCESS 2007 and Outlook 2007. I have a code to open a blank email and I can insert the field property into the CC field, which is great, but I can't figure out how to sucessfully integrate with a template.

HELP Please!
 

TourOperator

Registered User.
Local time
Today, 12:49
Joined
Sep 11, 2014
Messages
14
Hi Brian006,

Your problem is similar to mine. Word merge from a form.

Post-2007 Access would allow you to merge from a Parameter Query (your query filters what you want using a formula like [Forms]![MyForm]!), but post-2007 no longer allows this.

I believe you need to create some VBA code including some SQL filtering by WHERE [MYTABLE].[email] = Me![Email]. Then get the VBA to insert the results in your Outlook field.

I'm no expert, but if you get no other replies, this may at least give you some ideas.
 

DavidAtWork

Registered User.
Local time
Today, 12:49
Joined
Oct 25, 2011
Messages
699
working with email templates works fine when the email body is to remain unchanged, but trying to edit the body text and insert variable values is probably more work than coding the complete body text in vba, where you can use variable's values.

If there are only a couple of variables, you might consider just incorporating these in the email subject which is easily editable when using a template

David
 

brian006

New member
Local time
Today, 08:49
Joined
Sep 27, 2014
Messages
3
DavidAtWork,

Thanks for your reply. What you're saying makes sense. I can't seem to find the code to insert the fields into outlook.
 

brian006

New member
Local time
Today, 08:49
Joined
Sep 27, 2014
Messages
3
What code would I use to open an outlook template file and make a change to the subject?
 

Users who are viewing this thread

Top Bottom