By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

E-Mail in Access

P: 2
I have some experience with Access but not with advanced features such as integrating e-mail into a database. I created a client contact database for a company, and would like a new Outlook Express e-mail to open (addressed to the particular client), when someone clicks on the e-mail address. I have two tables and a macro, no queries or forms. (But don't mind creating one or both if necessary.)

I would greatly appreciate it if someone could walk me through this process. I'm under a two week deadline so I'd like to get this done as quickly and simply as possible.

I'm running Access 2003 on Windows XP Pro. Feel free to let me know if you need anymore details. Thanks so much!
Jul 16 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 114
You can send e-mails using the SendObject command.
This can auto e-mail reports or tables to pre-selected or post-selected person(s).

Expand|Select|Wrap|Line Numbers
  1. DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
  2.     "Nancy Davolio; Andrew Fuller", "Joan Weber", , _
  3.     "Current Spreadsheet of Employees", , False
DoCmd.SendObject ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile

The best thing to do it make a list box with all the e-mail addresses in it (E.g. lstEmailAddresses) and have a for loop to add all the e-mail addresses into a string (E.g. strTo for the to field and strCc, strBcc for the CC and BCC fields if you want them added to that instead).

Expand|Select|Wrap|Line Numbers
  1. Dim strTO As String
  2. Dim strCc As String
  3. Dim rptcount As Long
  4. Dim cnt As Long
  6.     If Me.lstEMailAddresses.ItemsSelected.Count = 0 Then
  7.         MsgBox "No email addresses have been selected; please select one or more email addresses, and then try again."
  8.     Else
  10.         For cnt = 0 To Me.lstEMailAddresses.ItemsSelected.Count - 1
  11.             strTO = strTO & ";" & Me.lstEMailAddresses.Column(0, Me.lstEMailAddresses.ItemsSelected(cnt))
  12.         Next cnt
  13.         strTO = Mid(strTO, 2)
Hope this helped.
Jul 17 '07 #2

P: 2
Thanks so much for replying and trying to help! However, I am a bit lost here. Could you please clarify your instructions for a beginner like me? :-)
Jul 17 '07 #3

Expert 100+
P: 114
You should make a query that takes all the e-mail addresses and the companies.

Then make a form and put a list box with the source being the e-mail addresses in your query. You can then put a combo box with the companyís names in it to filter the query and limit the list of e-mail addresses. What happens then is when you select a company from your combo box then only the e-mail addresses associated with that company should be in your list box.

Form Name: emailform
Combo Box Name: Combo0
List Box Name: lstEMailAddresses

So on your query you should have
Expand|Select|Wrap|Line Numbers
  1. [Forms]![emailform]![Combo0]
in the company field. This will filter your list box lstEMailAddresses.

Once you get this working let me know and I will post the next part.
Jul 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.