Microsoft KB Archive/96068

= Use && to Display Ampersand Character in MsgBox Text =

PSS ID Number: 96068

Article Last Modified on 1/9/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q96068



SYMPTOMS
The MsgBox statement and the MsgBox function fail to display the ampersand (&) character in the message text. The MsgBox statement incorrectly interprets the ampersand as indicating that the next character is an access key, as in label captions.



WORKAROUND
To work around the problem, write two ampersands in a row (&&) to cause one ampersand to appear in the message.



STATUS
Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The following statement reproduces the problem: MsgBox &quot;a & b&quot; This incorrectly displays a b. To correct this example, use &&: MsgBox &quot;a &amp;&amp; b&quot; This incorrectly displays a & b.

Additional query words: VBmsdos buglist1.00 1.00

Keywords: KB96068

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.