ACC: SendObject Action Replaces Comma with Semicolon

Last reviewed: August 29, 1997
Article ID: Q127972
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

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

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

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb (or NWIND.MDB in Access 2.0).

  2. Create a new form that is not based on any table or query.

  3. Add a command button to the form. Set the button's OnClick property 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."
    
    

  4. 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 a comma.

REFERENCES

For more information about the SendObject action, search the Help Index for "SendObject Action," or ask the Microsoft Access 97 Office Assistant.


Additional query words: transmit mapi
Keywords : kbprg SynFnc
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.