Email problem 01-29-08

Hello,

I am trying to put in 5 five names in the SendCC and it works fine for the 
first three but when I drop to the next line to add the other two, I get a 
syntax compile error and the last two name appear in red. Could someone 
please help me. I'm sure I am not adding something in the code but don't know 
what.

Here is the code I am using:

On Error GoTo EH
    Dim SendTo As String, SendCC As String, MySubject  As String, MyMessage 
As String
    SendTo = ""
    SendCC = "dalia.ssssssss@bankxxxxxx.com, 
alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
    MySubject = "Additional Information Needed"
    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " & 
Me.CustomerLast & vbCr & Me.ErrorCode & _
                      vbCr & Me.Comments
    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject, 
MyMessage, True

EH:
    If Err.Number = 2501 Then
        MsgBox "This email message has not been sent.  Message has been 
cancelled."
    End If

Thanks!!
0
Utf
1/29/2008 8:41:01 PM
access.formscoding 7494 articles. 0 followers. Follow

5 Replies
711 Views

Similar Articles

[PageSpeed] 51

You are missing a comma , after the third email address just before the &
myrna.sssss@bankxxxxxx.com should be myrna.sssss@bankxxxxxx.com,

Allan

"Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message 
news:484CAD50-3DFD-4A1A-8303-37877A6A3F4A@microsoft.com...
> Hello,
>
> I am trying to put in 5 five names in the SendCC and it works fine for the
> first three but when I drop to the next line to add the other two, I get a
> syntax compile error and the last two name appear in red. Could someone
> please help me. I'm sure I am not adding something in the code but don't 
> know
> what.
>
> Here is the code I am using:
>
> On Error GoTo EH
>    Dim SendTo As String, SendCC As String, MySubject  As String, MyMessage
> As String
>    SendTo = ""
>    SendCC = "dalia.ssssssss@bankxxxxxx.com,
> alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
>        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
>    MySubject = "Additional Information Needed"
>    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
> Me.CustomerLast & vbCr & Me.ErrorCode & _
>                      vbCr & Me.Comments
>    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
> MyMessage, True
>
> EH:
>    If Err.Number = 2501 Then
>        MsgBox "This email message has not been sent.  Message has been
> cancelled."
>    End If
>
> Thanks!! 


0
Allan
1/29/2008 9:35:18 PM
Hi Allan,

Thank you for responding. It didn't work. It still says Syntax error: 
Compile Error. If I place all the name in one row it works fine. However, I 
don't want to do that because I would like to know how to move it to the next 
line and still have it work in case I have more names to add. Is there 
another way or did I leave something else out?

Thanks!!!

"Allan Murphy" wrote:

> You are missing a comma , after the third email address just before the &
> myrna.sssss@bankxxxxxx.com should be myrna.sssss@bankxxxxxx.com,
> 
> Allan
> 
> "Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message 
> news:484CAD50-3DFD-4A1A-8303-37877A6A3F4A@microsoft.com...
> > Hello,
> >
> > I am trying to put in 5 five names in the SendCC and it works fine for the
> > first three but when I drop to the next line to add the other two, I get a
> > syntax compile error and the last two name appear in red. Could someone
> > please help me. I'm sure I am not adding something in the code but don't 
> > know
> > what.
> >
> > Here is the code I am using:
> >
> > On Error GoTo EH
> >    Dim SendTo As String, SendCC As String, MySubject  As String, MyMessage
> > As String
> >    SendTo = ""
> >    SendCC = "dalia.ssssssss@bankxxxxxx.com,
> > alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
> >        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
> >    MySubject = "Additional Information Needed"
> >    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
> > Me.CustomerLast & vbCr & Me.ErrorCode & _
> >                      vbCr & Me.Comments
> >    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
> > MyMessage, True
> >
> > EH:
> >    If Err.Number = 2501 Then
> >        MsgBox "This email message has not been sent.  Message has been
> > cancelled."
> >    End If
> >
> > Thanks!! 
> 
> 
> 
0
Utf
1/30/2008 1:15:00 PM
Try this
    "dalia.ssssssss@bankxxxxxx.com, alpheretta.sssss@bankxxxxxx.com, 
myrna.sssss@bankxxxxxx.com " & _
    vbcrlf & "sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"

the vbcrlf  is visual basic for Carriage Return Line Feed. Like the old 
typewriter days move to the start of the current line then add a linefeed 
(new line)

Allan


"Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message 
news:1FCF7C7A-B38C-45EC-9F42-B83724CED783@microsoft.com...
> Hi Allan,
>
> Thank you for responding. It didn't work. It still says Syntax error:
> Compile Error. If I place all the name in one row it works fine. However, 
> I
> don't want to do that because I would like to know how to move it to the 
> next
> line and still have it work in case I have more names to add. Is there
> another way or did I leave something else out?
>
> Thanks!!!
>
> "Allan Murphy" wrote:
>
>> You are missing a comma , after the third email address just before the &
>> myrna.sssss@bankxxxxxx.com should be myrna.sssss@bankxxxxxx.com,
>>
>> Allan
>>
>> "Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message
>> news:484CAD50-3DFD-4A1A-8303-37877A6A3F4A@microsoft.com...
>> > Hello,
>> >
>> > I am trying to put in 5 five names in the SendCC and it works fine for 
>> > the
>> > first three but when I drop to the next line to add the other two, I 
>> > get a
>> > syntax compile error and the last two name appear in red. Could someone
>> > please help me. I'm sure I am not adding something in the code but 
>> > don't
>> > know
>> > what.
>> >
>> > Here is the code I am using:
>> >
>> > On Error GoTo EH
>> >    Dim SendTo As String, SendCC As String, MySubject  As String, 
>> > MyMessage
>> > As String
>> >    SendTo = ""
>> >    SendCC = "dalia.ssssssss@bankxxxxxx.com,
>> > alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
>> >        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
>> >    MySubject = "Additional Information Needed"
>> >    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
>> > Me.CustomerLast & vbCr & Me.ErrorCode & _
>> >                      vbCr & Me.Comments
>> >    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
>> > MyMessage, True
>> >
>> > EH:
>> >    If Err.Number = 2501 Then
>> >        MsgBox "This email message has not been sent.  Message has been
>> > cancelled."
>> >    End If
>> >
>> > Thanks!!
>>
>>
>> 


0
Allan
1/30/2008 10:52:31 PM
You don't need any "carraige returns" in your string, so

SendCC = "dalia.ssssssss@bankxxxxxx.com, alpheretta.sssss@bankxxxxxx.com, " 
_
& "myrna.sssss@bankxxxxxx.com, sharon.sssss@bankxxxxxx.com, 
jeanette.ssss@bankxxxxxx.com"

will work just fine. Note that there is a blank between the
quote and the continuation under-score.

I have to ask: Why do you find yourself having to hard-code
e-mail addresses in your code, rather than taking them from
your database as fields?

Bill





"Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message 
news:484CAD50-3DFD-4A1A-8303-37877A6A3F4A@microsoft.com...
> Hello,
>
> I am trying to put in 5 five names in the SendCC and it works fine for the
> first three but when I drop to the next line to add the other two, I get a
> syntax compile error and the last two name appear in red. Could someone
> please help me. I'm sure I am not adding something in the code but don't 
> know
> what.
>
> Here is the code I am using:
>
> On Error GoTo EH
>    Dim SendTo As String, SendCC As String, MySubject  As String, MyMessage
> As String
>    SendTo = ""
>    SendCC = "dalia.ssssssss@bankxxxxxx.com,
> alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
>        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
>    MySubject = "Additional Information Needed"
>    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
> Me.CustomerLast & vbCr & Me.ErrorCode & _
>                      vbCr & Me.Comments
>    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
> MyMessage, True
>
> EH:
>    If Err.Number = 2501 Then
>        MsgBox "This email message has not been sent.  Message has been
> cancelled."
>    End If
>
> Thanks!! 


0
Bill
1/31/2008 6:00:56 PM
I see my note didn't format as intended when
posted, as the under-score got placed on a
separate line.

A better demonstration would be:

SendCC = "dalia.ssssssss@bankxxxxxx.com, " _
             & "alpheretta.sssss@bankxxxxxx.com, " _
             & "myrna.sssss@bankxxxxxx.com, " _
             & "sharon.sssss@bankxxxxxx.com, " _
             & "jeanette.ssss@bankxxxxxx.com"

Bill


"Bill" <billstanton@psln.com> wrote in message 
news:x8Kdnd5XbqpDkT_anZ2dnUVZ_v-hnZ2d@trueband.net...
> You don't need any "carraige returns" in your string, so
>
> SendCC = "dalia.ssssssss@bankxxxxxx.com, alpheretta.sssss@bankxxxxxx.com, 
> " _
> & "myrna.sssss@bankxxxxxx.com, sharon.sssss@bankxxxxxx.com, 
> jeanette.ssss@bankxxxxxx.com"
>
> will work just fine. Note that there is a blank between the
> quote and the continuation under-score.
>
> I have to ask: Why do you find yourself having to hard-code
> e-mail addresses in your code, rather than taking them from
> your database as fields?
>
> Bill
>
>
>
>
>
> "Stockwell43" <Stockwell43@discussions.microsoft.com> wrote in message 
> news:484CAD50-3DFD-4A1A-8303-37877A6A3F4A@microsoft.com...
>> Hello,
>>
>> I am trying to put in 5 five names in the SendCC and it works fine for 
>> the
>> first three but when I drop to the next line to add the other two, I get 
>> a
>> syntax compile error and the last two name appear in red. Could someone
>> please help me. I'm sure I am not adding something in the code but don't 
>> know
>> what.
>>
>> Here is the code I am using:
>>
>> On Error GoTo EH
>>    Dim SendTo As String, SendCC As String, MySubject  As String, 
>> MyMessage
>> As String
>>    SendTo = ""
>>    SendCC = "dalia.ssssssss@bankxxxxxx.com,
>> alpheretta.sssss@bankxxxxxx.com, myrna.sssss@bankxxxxxx.com &_"
>>        sharon.sssss@bankxxxxxx.com, jeanette.ssss@bankxxxxxx.com"
>>    MySubject = "Additional Information Needed"
>>    MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
>> Me.CustomerLast & vbCr & Me.ErrorCode & _
>>                      vbCr & Me.Comments
>>    DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
>> MyMessage, True
>>
>> EH:
>>    If Err.Number = 2501 Then
>>        MsgBox "This email message has not been sent.  Message has been
>> cancelled."
>>    End If
>>
>> Thanks!!
>
> 


0
Bill
1/31/2008 6:10:38 PM
Reply:

Similar Artilces:

expression 03-10-08
I have a form for a rolling report. I need to add some criteria, and I was doing so in the query end of it, that has the following: ClassID = 12 or 14 This is all based on what Class they select from the form. Class ID 14 or ClassID of 12. If ClassID = 14, exclude all parts between "401 000" and "401 999" That is only for ClassID or 14, ClassID or 12 needs to show all parts. Do I continue in my query or do I need to do that behind my form? If so in my query what's the best way? I have tried using several different operators, Like, Between, <>, and nothing works...

Can Recieve email but cannot send out
For Outlook 2003, cannot send out. Have internet connection, and can receive emails. I have tried disabling firewall and Norton, but no luck. Any suggestions? are you getting any kind of error back? "Mark Sanford" <anonymous@discussions.microsoft.com> wrote in message news:cc5901c43909$3916a210$a301280a@phx.gbl... > For Outlook 2003, cannot send out. Have internet > connection, and can receive emails. I have tried > disabling firewall and Norton, but no luck. Any > suggestions? "Mark Sanford" <anonymous@discussions.microsoft.com> wrote in me...

I have a problem with the attachment
I use a mail with an attachment and I make any changes in it, even though I save it, at the time of closing the next time I open it, the changes do not appear. I suppose there must be an tmp file any place. I want to know is where can I find the file that I make changes, because I use save instead off save as. please help me Hi kiplingirapuato, Re: I suppose there must be an tmp file any place Answer: NO, the file was erased when you closed it. When an attachment is opened OE creates it in a tmp file, when attachment is closed OE erases the tmp file. Ken "kipling...

HELP: Lost all my old emails
Hello, First there was the power failure. Then there was Windows XP recovery program (that ran automatically). Now, my desktop is blown away and all my Outlook emails and contacts are gone. Could these files be lurking in some obscure directory? Don't say search for dbx files. My computer doesn't have any. I'm running Windows XP media edition. Regards and thanks. do a search for pst files. or you can try .pab files for your personal address book. If those arent there.. You might be screwed! I save my pst files on my server where they are backed up.. for just this re...

Excel Date Problem
A client has a spreadsheet which was sent from the US, and therefore a column of date entries are in the format of US type ie: 02/30/05 ie 30th feb 2005 I want these to be changed to the UK version ie: 30/02/05 However as regional settings are set to UK, Excel does not recognize 02/30/05 as a date in the first place, and does not convert it to a UK format accordingly. Also, despite formatting the column for date it still does not work. I tried switching to a US locale, hoping that Excel would then recognize 02/30/05 as a date, and then back to UK again but this did not work. He has seve...

outlook email questionaire
I want to send an email to clients that has a questionaire on it with text answers. I want them to be able to answer the questions and then click a button at the bottom of the page that will send it directly to my email without them having to enter my address. How do I do this? Well, i's possible to do what you want (mail a form to someone that's editable on the receiving end and runs code to send mail when done) but is not easy. Check out www. outlookcode.com for some ideas on how to approach this. If you are not using an exchange server, I'd recommend using Form Regions...

Email
I have created a simple Access database that our HR department will use to input demographic information on a new employee, as well as what software, access, etc. a new employee will need. Again, it is VERY simple, but what I can't figure out is how to create a button that the HR staff can click on and the file, with all the information, is emailed to our IS department. Can this be done? You can setup a report to based on your current record and email it using SendObject or using Outlook automation. This does require a minimal amount of VBA programming in either case. If you sear...

Can't forward to an external email address...
We have a user that uses his external AOL account as well as his company email account. He has asked me to forward all company mail to his external AOL account. I figured I'd be able to just go into the delivery options on the "Exchange General" tab for his user profile and forward to the appropriate address. However, you cannot enter just any address in there, it forces you to select an address from the directory - of course his AOL address is not there. Is there an easy way to forward all mail from his internal account to an external account? I tried creating a rule on his Out...

XSLT Extension Object Problem
In my old VB6 application I have an xslt extension object that builds a small cross reference document and returns it as a NodeList in my XSLT. I can then use it with xpath expressions as $nodeset/xpath and I would get my values or use xsl:copy-of and I would get the whole document in my results tree. In my .Net version I don't get anything with my $nodeset/xpath expression and if I use the xsl:copy-of I get a value of System.Xml.XPath.XPathNodeList. I know this is the real object of the node set but what am I doing wrong for it not to be a node-set when it returns to my XSLT? Anyone...

email addresses in memory
An outlook 2003 user states that when sending out an email and when they type in a letter in the "to" area the email addresses that were in memory when you type a letter or name are gone. They said they didn't do anything different. The addresses are in the contact list but there is nothing in memory so you have to type the whole address in. Is this possible or can address in memory be deleted or removed? They are stored in the *.nk2 file located in Docs&Settings\Application Data\Microsoft\Outlook (by default) You dont have to type the address in, just click the &...

Unlinking tracked emails in CRM 3.0
I find that once an email is linked to/tracked by CRM (Customer, Client, Activity) it can't be unlinked! only deleted. For example; A client uses an old CRM generated email containing the tracking token to ask about a new problem. CRM automatically tracks the new email to the old CRM case and I can't untrack it to link it to a new case. Any information would be helpful... Hi, Check out "How to "untrack" Microsoft CRM Outlook e-mails" on following blog http://blog.sonomapartners.com/ -- PLEASE do click on Yes or No button if this post was helpful or not for ou...

problems synchronizing for offline viewing
Anyone know what the problem is? Tried synchronizing on another laptop and it went through (2002 outlook), but on the 2000 outlook sp1, doesn't go. used to work. 11:50:15 Synchronizing Hierarchy 11:50:16 Synchronizing Favorites 11:50:16 Synchronizing Folder 'Inbox' 12:00:02 Error synchronizing folder 12:00:02 [80040102-501-0-550] 12:00:02 The client operation failed. 12:00:02 Microsoft Exchange Server Information Store 12:00:02 For more information on this failure, click the URL below: 12:00:02 http://www.microsoft.com/support/prodredirect/outlook2000_u s.asp?...

Korean email
I can type and send Korean characters in emails but cannot receive them in Outlook 2003. Any help? ...

How do I Full screen an Email???
I looking for a way to look at an email that I receive in a full screen mode. The way I'm trying to see it is like I was in I.E. and pressed the f11 key or if I was in Word or Excel & used the Alt+V+U function for full screen. What I am trying to see just the heart of the email not the header or anything else but the email body Craig <cb3_3@hotmail.com> wrote: > I looking for a way to look at an email that I receive in > a full screen mode. The way I'm trying to see it is like > I was in I.E. and pressed the f11 key or if I was in > Word or Excel & us...

OWA Problem #12
Hi, I have exchange 2003 with SP1. When i send any mail using OWA to yahoo or any internet account . I got ? before the message contents. Cananybody help me out to resolve this issue. Thanks, Abhi. ...

Excel 2003 #29
I have calculated cells formatted for Currency w/ 2 decimal places// when print they have 15 decimal places // I've tried standard formatting Number & Accounting and they also print 15 decimal places when formatted for 2 decimal places // how can this be corrected so when cell formatted for 2 decimal places it will print 2 decimal places ? This is not standard excel behavior. Are you sure you changed the number format? Any chance you have some kind of macro that changes the numberformat before you print? Martins wrote: > > I have calculated cells formatted for Currency w...

outlook express outgoing email disappears
I use Windows98 SE and Outlook Express6. Sometimes and with different addressees when I send an email it is received by the addressee ok but it is not in my sent items folder so I have no record of it! It does not happen every time -- perhaps about 1 in 6. I'M probably overlooking the obvious. Suggestions welcome. i suggest the outlook express newsgroup -Gary "Sean Dunne" <dunnes@iol.ie> wrote in message news:128d001c3f72d$d457f8f0$a101280a@phx.gbl... > I use Windows98 SE and Outlook Express6. Sometimes and > with different addressees when I send an email it...

Instant search of emails (10,000) fails
Failure of instant search requires reboot befor resolving for search or two and again fails ...

Emails not leaving outbox
Hi all - I am having what seems to be a common problem, but all of the suggested fixes I found did not work. I have set up SQLServer to use MAPI to email notifications. I have Outlook 2000 installed and configured and working. The SQLServer notifications part isworking too. The only thing I can't figure out is the emails never leave the outbox until I start Outlook and click Send/Receive. Then they are all sent fine. I read some articles mentioning MAPISP32, which appears to be the culprit. From what I see it's supposed to spool emails that are in the Outlook outbox. I found after I ...

Missing text in email
I recently installed Exchange 2003. From time to time when my users send email outside the company there messages are missing text upon arrival. The text missing could be two sentences at the end of a paragraph and the next one starts okay, or it could be a very words missing here and that. Any ideas of this Michelle P. Michelle: I know you have probably thought about this already, but do you have any type of content inspection system installed on your Exchange server? Or anything installed that stamps a message disclaimer on the message. Is the message changed by the clien...

email forwarding to my other email
I have two email accounts. One I use for work and the other for personal. For some reason, my personal email is being forwarded to my work email. I don't know why and how do I stop it....? Are these POP3 accounts? Has it ever worked? Are they separate accounts, or addresses that are aliases for the same Inbox? Does your personal e-mail show in both places, or is it going to your work only? Any rules set up in WinMail, or on the server's Website? -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "az otr" <az otr@disc...

question about grouping the emails.
Hi, I am signed-up to a discussion group and i get question about a prob and also solutions as a reply. i am grouping the e-mails by subject, For example... subject: "problem with ABCDE" in reply the subject will be "RE: problem with ABCDE" now Outlook2003 is grouping these two into seperate groups and if there is a reply with subject "RE:RE: problem with ABCDE" it groups that seperately. i want to group the replies also into the same group. the reply to the emails are grouped seperately. i want to have an exception in the grouping saying to ignore the word...

Outlook Client
Hi all, In the web client there is an email icon available from the views which allows you to send a direct email to the selected records in the view. Does anyone know if there is any way to call this from the Outlook client. Appreciate it :) cheers Nathan Hi, I'm afraid I can't help you out on this one. But I found that it's not only the icon missing in the Outlook client, but as soon as the Outlook client is active, the icon disappears in the Webclient also. This seems the same issue to me as the settings button disappearing when the Outlook client is active, wh...

Not receiving emails
I have not checked my emails for 1 week. Now when I try to log in it ask for a user name and password. When I enter them it states Your servers has unexpectedly terminated the connections 0x800CCC0F???????????????? I can send messages but can't receive HELP ANYONE. Pam C wrote: > I have not checked my emails for 1 week. Now when I try > to log in it ask for a user name and password. When I > enter them it states Your servers has unexpectedly > terminated the connections 0x800CCC0F???????????????? > I can send messages but can't receive HELP ANYONE. This is an is...

Hyperlinks blocked within email messages
Suddenly I can't open any links from within received messages. I receive the following error message: "This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator." "System administrator" would be me. This is a standalone computer connected via a Linksys router to a cable modem. There's no domain involved and there are two Users (both administrators) set up, only one of which has the problem. I'm using Outlook 2007 under Vista Ultimate and this has only started happening in the last week...