ACC2000: SendObject Action Replaces Comma with Semicolon (210309)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q210309
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

When you include a comma (,) as part of the To argument for a SendObject action in a macro or code, Microsoft Outlook and Microsoft Outlook Express display 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 example.
   DoCmd.SendObject , , , "'Fuller, Andrew'", , , "This is a test."
				
This practice causes the text to be treated as a literal string, and prevents Microsoft Access from translating the embedded commas into semicolons.

STATUS

This behavior was designed to ensure that a semicolon separates recipients' names when you send mail to two or more people.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access and open any database or project.
  2. Create a new form that is not based on any table or query.
  3. Add a command button to the form. Set the OnClick property of the button to the following event procedure:
    Private Sub Command0_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 Outlook or Outlook Express Message form appears. Note that the first and last names in the To box are separated by a semicolon rather than by a comma.

REFERENCES

For more information about the SendObject action, click Microsoft Access Help on the Help menu, type sendobject action in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kbprb kbProgramming KB210309