Microsoft KB Archive/127972

= ACC: SendObject Action Replaces Comma with Semicolon =

Article ID: 127972

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q127972



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you include a comma as part of the To argument for a SendObject action in a macro or code, Microsoft Mail displays the comma as a semicolon  when the action runs.



RESOLUTION
NOTE: The following code may not work properly if you have installed the Outlook E-mail Security Update. For additional information about this update, please see one of the following articles in the Microsoft Knowledge Base, depending on which version of Outlook you have:

262631 OL2000: Information About the Outlook E-mail Security Update

262617 OL98: Information About the Outlook E-mail Security Update

To work around this behavior, enclose the text in the To argument in single quotation marks (' ') and enclose the entire string in double quotation marks (" "), as in the following examples.

In Microsoft Access 7.0 and 97:

DoCmd.SendObject, , , "'Fuller, Andrew'", , , "This is a test."

In Microsoft Access 2.0:

DoCmd SendObject, , , "'Fuller, Andrew'", , , "This is a test."

This causes the text to be treated as a literal string, and prevents Microsoft Access from translating the embedded commas into semicolons.



STATUS
This behavior is by design to ensure a semicolon separates recipients' names when you send mail to two or more people.



Steps to Reproduce Behavior
 Open the sample database Northwind.mdb (or NWIND.MDB in Access 2.0). Create a new form that is not based on any table or query.  Add a command button to the form. Set the OnClick property of the button to the following event procedure.

In Microsoft Access 7.0 and 97: Private Sub Command0_Click DoCmd.SendObject, , , "Fuller, Andrew", , , "This is a test." End Sub In Microsoft Access 2.0: Sub Button0_Click DoCmd SendObject, , , "Fuller, Andrew", , , "This is a test." End Sub Note the comma between "Fuller" and "Andrew."  View the form in Form view and click the command button. A Microsoft Mail or Exchange dialog box appears. Note that the first and last names are separated by a semicolon rather than by a comma.

<div class="references_section">