MS Access Vs MS Outlook

Download Sample Access File: MS Access Vs MS Outlook

MS Access is a database based program, but MS Outlook is communication program of sending and receiving mail. MS Access can be programmed to work with MS Outlook by sending data in Access to another user via email. It can also set task due to another from data in the Access tables.

There are two MS Access Files in this download zip file:

  1. Access Vs Outlook
  2. Format HTML Body Email

File 1 -Access Vs Outlook

Highlight functions or features in this sample file include:

1. Email Files from the List Box. Selecting file manually from any folder and adding them to the list box. Then send those files from list box to the customer selected from the dropdown box. From the example below, three files are added on the list box and customer Paul Smith is selected to be emailed to. After clicking “Send Email”, Outlook will display with three files attached and ready to send to email of Paul Smith.

send file from listboxOL send file from listbox

  1. Set Task in Outlook for yourself. Select task and Click on Set Task in Outlook button. The task detail will be set in your Outlook as programed under the Click Event Procedure. You can copy and modify code for your program as your want.

set task for yourselftask in OL for self

  1. Set Task to Other Users. We can set task to a specific employee that selected from the dropdown list. If employee has an email address then the task will be set to that employee as shown below.

set task to anotherconfirmed task sent

One task can also be set to multiple recipients. For instance, if there is no specific employee assigned to this task then the task will be sent to all employees who have the email address on the employee table. The code below is using the Do Until loop to add all employee emails to the list.

OL send task to one personcode set task to another

  1. Attach PDF file to Email. After a customer name is selected on this form and click Email PDF button, as coded, the email will display and ready to send to that customer that has an email address. If the customer has no email address the message will pop up. The location of PDF file can be modified as needed.

attach pdf to emailAttach PDF OL

  1. Send Email to One Customer. The search form is used to search for customer name and can email for that customer by clicking on email button corresponding to the customer name. In this example, you will learn how to send email to customer and also how to create search form by keyword. For instance, click on email button for Masters Bob the Outlook will display new email ready to send to Masters Bob.

send email to onesend email to one in OL

6. Send Email to Multiple Customers. Email can be sent to many customers who have email address listed on Access form. For example below, the list of customer with customer type of Individual will display on the subform after the Individual customer type is selected from combo box. Click on Send Email button to send email to these customers on the list. If there is no customer type is selected email will be sent to all customers who have emails per coding behind the Send Email button.

send email to many recipientssend email to many recipients OL

  1. Convert Access Report to PDF and Attach to Email. a) I have a Customer List report shown below. However, I want to send this report to all customers I will click on Email button without selecting any customer from the list. VBA will convert a report to PDF file and save it to computer and will remove it from computer after sending to customers successfully.

customer listconvert and attach

convert and attach to all

 b) If the customer name is selected from a dropdown list and click Email button, a new Outlook email will be sent to only the selected customer. For instance below, the email with attached file will be sent to Paul Smith only when Paul Smith is selected.

convert and sent to oneconvert and attach to one in Display

8. Attach Signature to Email with Message Body. At first, you have to set the Signature for your email in Outlook. The signature should always attach to your new email automatically. However, you will need to program in Access VBA to attach that system Signature to your email under the Click Event Procedure of the “Email with Signature” button in Access as shown below.

set up signatureattach signatureattach sig in Outlook

Download file contains:

6 tables, 3 queries, 11 Forms, and 1 Report

form attach in outlook          table in outlook

 

File 2 -Format HTML Body Email

1) Form Task Due: This file is an additional file that shows how to format the email body for Outlook. It has only one form that will use to attach some information from this form with the email. Task #5 is selected on this form then click on “Send Email.”

format htlm

It will open MS Outlook ready to send email to other the html formatting on the email body.

The picture below is showing the example of formatting text.
  1. Text bold
  2. Use tab in a line
  3. Color the text
  4. Underline the text
  5. Highlight the whole row
  6. Color background the whole row
  7. Link to URL address

html in email

2) Form Table Format: This form will demonstrate how to put information from Access form inside the table on the email body. The other types of format also are included within the table. Task #4 is selected on this form then click on “Send Email with Table formatting.”

format table

It will open MS Outlook ready to send email to other the html formatting on the email body.

The picture below is showing the example of formatting the table in email body.

Table formatting with:

  1. table width = 500
  2. colspan or Merge two columns on first row
  3. center text on first row
  4. set columns width = 300 and 200
  5. set table cellpadding = 5
  6. border =1 with cellspacing =0
  7. text color on first column = blue
  8. font text on first column = bold
  9. color background the whole row
  10. link to URL address outside of table

table in email boday