Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

When you enter a list of strings for the RowSource property in an Access form or report, the strings are truncated


View products that this article applies to.

Symptoms

Consider the following scenario. In a Microsoft Access form or report, you enter a list of strings for the RowSource property of a combo box or of a list box that displays a value list. When the focus moves away from the RowSource property, the strings that you entered are truncated. For example, if you entered "value "a"";"value "b"", these strings are truncated as follows:
"value ";"value "
Note The value placeholder represents any value that you might enter. This problem occurs only when a string in the RowSource property starts with a quotation mark. Additionally, this problem may occur for any or all strings in the RowSource property that start with a quotation mark.

Note In this scenario, "quotation mark" refers to either a single quotation mark (') or a double quotation mark (").

↑ Back to the top


Cause

This problem occurs because of the rules that the string parser applies when it analyzes each string that was entered for the RowSource property.

In this case, the string parser analyzes a string that starts with a quotation mark. The string parser moves along the string and searches for another quotation mark that matches the quotation mark that starts the string. When the parser finds the qualified quotation mark, all the characters after that quotation mark will be deleted. However, any two consecutive identical quotation marks that are not at the start of the string will be kept. Neither of these identical quotation marks will be treated as the qualified quotation mark. If the parser cannot find the qualified quotation mark at the end of the string, the string will not be truncated.

The examples in the "More Information" section demonstrate the rules that the string parser applies when it analyzes a string that starts with a quotation mark.

↑ Back to the top


Workaround

When you use quotation marks to delimit strings, make sure that you type a pair of quotation marks for any quotation mark that you want to appear in the value list. For example, assume that you want the following to appear in the value list:
ab"c
In this case, make sure that you type "ab""c".

Note When you do not use quotation marks to delimit strings, type only the characters that you want to appear in the value list. For example, assume that you want the following to appear in the value list:
ab"c
In this case, type ab"c.

↑ Back to the top


Status

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

↑ Back to the top


Keywords: KB918587, kbprb, kbtshoot, kbexpertisebeginner

↑ Back to the top

Article Info
Article ID : 918587
Revision : 3
Created on : 11/3/2006
Published on : 11/3/2006
Exists online : False
Views : 336