473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

email address as string

I have searched this form and did google and yahoo but to no avail. I'm trying to send a report via email to email addresses listed in the report but I’m not getting anywhere. This is what I have so far....
Expand|Select|Wrap|Line Numbers
  1. Function Macro1()
  2. On Error GoTo Macro1_Err
  3. Dim strSendTo As String
  4. strSendTo = ProjectManagerEMail
  5.  
  6.     DoCmd.SendObject acReport, "month", "SnapshotFormat(*.snp)", strSendTo, "", "", "", "", False, ""
  7.  
  8.  
  9. Macro1_Exit:
  10.     Exit Function
  11.  
  12. Macro1_Err:
  13.     MsgBox Error$
  14.     Resume Macro1_Exit
  15.  
  16. End Function
  17.  
I also tried creating another table with just email addresses but couldn't get that to work either. please help. What am I doing wrong?

To state the obvious: I’m very new at this!
Dec 28 '07 #1
5 2012
Minion
108 Expert 100+
I have searched this form and did google and yahoo but to no avail. I'm trying to send a report via email to email addresses listed in the report but I’m not getting anywhere. This is what I have so far....

Function Macro1()
On Error GoTo Macro1_Err
Dim strSendTo As String
strSendTo = ProjectManagerEMail

DoCmd.SendObject acReport, "month", "SnapshotFormat(*.snp)", strSendTo, "", "", "", "", False, ""


Macro1_Exit:
Exit Function

Macro1_Err:
MsgBox Error$
Resume Macro1_Exit

End Function

I also tried creating another table with just email addresses but couldn't get that to work either. please help. What am I doing wrong?

To state the obvious: I’m very new at this!
I haven't had a chance to test the mailing feature of Access, though I have looked into in recently for a proposed module. Below I will include a couple links I have on mailing from Access that may help you, but first there is something in your code that might be causing you the error.

Try switching the DoCmd line to the following and see if it works out:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SendObject acSendReport, "month", "SnapshotFormat(*.snp)", strSendTo, , , , , False
  2.  
If this doesn't work I would look furthing into the matter with the following links

Sending Email From Access (Advanced)

Sending Email From Access (Beginner)

Hope some of this helps you.

- Minion -
Dec 28 '07 #2
Nope, that didn't work :(
I have looked at those two articles before and am currently palying with the code to make it work for me.
There got to be something in between those two methods discussed by the articles you have pasted the url for. I'm think there got to be a way to add couple lines of code to grab the email address from a query, no?
Dec 28 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
My first question is where is ProjectManagerEmail coming from? Is this a control on a form? Is the form open?

You have written your code in a function. Where is this function written and how and where is it called?
Jan 8 '08 #4
My first question is where is ProjectManagerEmail coming from? Is this a control on a form? Is the form open?

You have written your code in a function. Where is this function written and how and where is it called?
I have a table which contains a filed label ProjectManagerEmail. I created a micro and then converted that to a module. I have very limited programing and access knowledge...function is created by access.
Jan 15 '08 #5
report which i would like to email also contains ProjectMangerEmail field.
Jan 16 '08 #6

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

Similar topics

9
by: Martoni | last post by:
I need to parse a string with an embedded email address. The string always has the format NAME (name@domain) SOMETEXT. What I need to get is the email address as name@domain. I came up with this...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
0
by: MikeM | last post by:
The email address stays through each loop and keeps adding the next email address. joe@email.com then the next run would be joe@email.com; mike@email.com etc... The subject and the attached file...
2
by: Del | last post by:
I have two question on sending email messages from MS Access (Versio 2000, 2002, and 2003). I have a form with a command button to send an email message, the code behide the button is as follows;...
4
by: acni | last post by:
I have the following peice of code to try and send an email to selected contacts in my form.The problem is this line: StrStore = DLookup("", "qrySelectEmail", "??????") This looks up the email...
11
by: Brian Henry | last post by:
I have a domain cluster with AD running, and I want to lookup a users email address (exchange 2000 server is integrated with the AD system) so i can email the user based on their user name. does...
3
by: Jason | last post by:
I'm writing a simple EXE in VB.NET to be run on our intranet (Win2K network, XP machines). When it's done running I want to notify the user via email. I've got the email working...how do I...
1
by: darklink64 | last post by:
Hi, I've recently set up a database, but have not experience of VBA and need to find a way of solving this problem. Basically, I would like to make a form with two buttons. On clicking one...
2
by: comp.lang.php | last post by:
I came up with functions that I thought would do the trick: if (!function_exists('smtp_close')) { /** * This function will close a socket resource handle * * Original function found at...
1
by: creative1 | last post by:
When I test the application I get follwowing error: could not connect to smtp host: connection timeout error can someone please check if I have rigth settings? Where I am wrong here Is IP and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.