OK, here it is, such as it is....
There are 4 teams of folks that may or may not be notified of a specific
event.. plus there is some special handling hard coded for some specific
events.
the single quote method has worked well thus far..
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Private Sub email_si_Click()
DoCmd.SetWarnings False
On Error GoTo com147err
Dim SI_Subject As String
Dim SI_Message As String
Dim SI_To As String
Dim SI_CC As String
Dim SI_BCC As String
Dim SI_SrMgr As String
Dim SI_SrMgrAlways As String
Dim TempSub As String
Dim TempKey As String
Dim strR1 As String
Dim strETDFail As String
Me.Refresh
' etd failures
strETDFail = "'xxxxxxxxxxxxx1; 'xxxxxxxxxxxxxx2; 'xxxxxxxxxxxxx3;
'xxxxxxxxxxxxx4;
'R1 Rules Violation Issues - entire subdivision
strR1 = "'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;"
'****** SI_To = "'xxxxxxxxxx7'; 'xxxxxxxxxxxxx8'; 'xxxxxxxxxxxx9';"
' ******* SI_BCC = "'xxxxxxxxxxxxxxx9';"
SI_CC = " "
' ****** If Me.SIPage = True Then SI_To = SI_To & "'xxxxxxxxxxxx10';
'xxxxxxx11';"
If Me.OPRPage = True And Len(OPREmail) > 1 Then SI_To = SI_To & Me.OPREmail
If Me.MOWPage = True And Len(MOWEmail) > 1 Then SI_To = SI_To & Me.MOWEmail
If Me.MECHPage = True And Len(MECHEmail) > 1 Then SI_CC = SI_CC & Me.MECHEmail
If Me.SIGPage = True And Len(SIGPage) > 1 Then SI_CC = SI_CC & Me.SIGEmail
If Me.SRMGRPage = True And Len(SRMGRPage) > 1 Then SI_CC = SI_CC &
Me.SRMGREmail
If Me.ETDPage = True Then SI_CC = SI_CC & strETD
'special handling for selected types of SI
If Me.OOFPage = True Then SI_CC = SI_CC & " 'xxxxxxxxxxx12';"
If Me.ETDPage = True Then SI_CC = SI_CC & strETDFail
If Me.RULESPage = True Then SI_CC = SI_CC & strR1
' setup to send message
If Len(Me.[SI Update Comments]) > 1 Or Me.[Has Updated] = True Then
SI_Subject = "UPDATE "
If [SI Page] = True Then SI_Subject = SI_Subject & "PAGE: "
SI_Subject = SI_Subject & "KC ROC SI: " & [SI Type] & " " & [SI Subdivision]
& " Subdiv"
SI_Message = Format([SI Start Time], "hh:nn") & " " & [SI Type] & " " &
UCase([SI Subdivision]) & " Sub At " & UCase([SI Location]) & " "
'put updated comments at top of message
If Len(Me.[SI Update Comments]) > 1 Then
SI_Message = SI_Message & Chr(10) & "UPDATED INFO: " &
Me.SI_Update_Comments & Chr(10) & Chr(10)
[Has Updated] = True
[Updated Time] = Now()
End If
SI_Message = SI_Message & "SI DESCRIPTION " & UCase([SI Event Description])
& Chr(10) & "COMMENTS: " & Me.[SI Comments]
DoCmd.SendObject , , , SI_To, SI_CC, SI_BCC, SI_Subject, SI_Message
[Has Emailed] = True
[Emailed Time] = Now()
Me.Refresh
Exit Sub
com147err:
Debug.Print Now()
Debug.Print err.Number
Debug.Print err.Description
Debug.Print SI_Subject
Debug.Print "TO " & SI_To
Debug.Print "CC " & SI_CC
'pause
'Stop
Exit Sub
End Sub
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is the debug print from the last execution....
1/11/2008 13:26:02
2295
Unknown message recipient(s); the message was not sent.
PAGE: KC ROC SI: **xxxxxxxxxxxxxx
TO 'OPR DL KCDAS'
CC
xxxxxxxxxxxxx
I know the TO recipient is a valid internal email name. .. I get the same
error if I remove the single quotes.
Believe it or not, we are running Windows XP Professional 2002 SERVICE PACK
1,
the company where I work has not yet approved SP2 for installation on our
workstations.....
Thanks
> OK, here it is, such as it is....
> There are 4 teams of folks that may or may not be notified of a specific
[quoted text clipped - 104 lines]
> the company where I work has not yet approved SP2 for installation on our
> workstations.....
Hmm, with everything you have masked out above, I can't tell whether the few
mistakes I see exist in the original. For example, you posted this:
> strR1 = "'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;"
But that's not valid, because you have a problem with the single-quotes.
The value of strR1 would be:
'xxxxxxxxxxxxxxxx5; 'xxxxxxxxxxxxxxxx6;
when it should be:
'xxxxxxxxxxxxxxxx5'; 'xxxxxxxxxxxxxxxx6';
In the test case you posted, was the message being sent *only* to "OPR DL
KCDAS"? I'm not sure whether you should expect 'OPR DL KCDAS' (in the
single-quotes) to be recognized or not. If, using Windows Mail, I send a
message to 'Dirk Goldgar' (in the single-quotes), it doesn't find the
contact entry that matches that name. But if I take it out of the
single-quotes, it does. I do recognize that you said you get the same error
if you remove the single-quotes, so I'm only speculating here.
If you make such a message manually, and enter the recipient as built above,
can the address be resolved?

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
bolo - 11 Jan 2008 20:46 GMT
> > OK, here it is, such as it is....
> > There are 4 teams of folks that may or may not be notified of a specific
[quoted text clipped - 129 lines]
> If you make such a message manually, and enter the recipient as built above,
> can the address be resolved?
Sorry, I blanked out the names for obvious reasons and went a space too
far.. the hardcoded names are correct...
On the test case, yes, OPR DL KCDAS is the only receipient i was expecting
(i removed all else to simplify the test.. The current system being used
works fine with the single quote delimited names.. (I am working on a copy
..fortunately) Somewhere they get stripped off because when the outlook
version comes up for them to edit/send, the single quotes are gone. I have
copied the names directly from the debug.print log to outlook and they
resolve fine.
Dirk Goldgar - 11 Jan 2008 20:59 GMT
> Sorry, I blanked out the names for obvious reasons and went a space too
> far.. the hardcoded names are correct...
That's what I figured, but of course I can't verify anything with regard to
the hard-coding of the addresses.
> On the test case, yes, OPR DL KCDAS is the only receipient i was expecting
> (i removed all else to simplify the test.. The current system being used
[quoted text clipped - 4 lines]
> copied the names directly from the debug.print log to outlook and they
> resolve fine.
So there's a current, production version of this application that is still
working properly? Does that version work correctly on the PC where you're
running the development version taht is failing? If not, then it must be
something about your system. If so, you need to focus on what is different
between the two versions. Beyond that, I'm afraid I have much to
contribute. I'm not seeing anything wrong in your code (except what looks
to have been introduced by your obfuscation), nor in debug results.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
bolo - 11 Jan 2008 21:15 GMT
> So there's a current, production version of this application that is still
> working properly? Does that version work correctly on the PC where you're
[quoted text clipped - 3 lines]
> contribute. I'm not seeing anything wrong in your code (except what looks
> to have been introduced by your obfuscation), nor in debug results.
Thanks for your help and quick responses
bolo - 11 Jan 2008 22:21 GMT
Well, you are not going to believe the cause of my problem..
When I built the email strings to populate my distribution lists, i
concatenated the end of each name with a & "'; "... it appears that the
space is the culprit.. I removed the space and changed the concatenation to &
"';"... it now again works perfectly with the single quotes on each name on
the input side of the sendobject which disappear on the outlook side.. I
dont know why.. It's friday and it works, so thats the end of my problem.
Thanks again for your help.