Microsoft KB Archive/90114

{|
 * width="100%"|

PRB: Nulls Not Concatenated with AND (+) Operator
'Article ID: Q90114

Creation Date: 08-OCT-1992

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1, 2.0, 7.0

SYMPTOMS

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

When you use the AND (&) operator, you can concatenate text to either side of a Null. However, when you try to do this with the AND (+) operator, a Null is returned.

CAUSE

The AND (&) operator treats nulls as empty strings. The AND (+) operator propagates nulls.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

Create a form and call it Form1. Add a text box to the form and call it Field0. View the Form1 form in Form view. Open a new module and type the following function: "Function Demonstrate" Forms!Form1!Field0 = Null + &quot;This is a string&quot; Debug.Print Forms!Form1!Field0 Forms!Form1!Field0 = Null & &quot;This is a string&quot; Debug.Print Forms!Form1!Field0 "End Function" In the Debug window (or Immediate window in versions 1.x and 2.0), type the following line, and then press ENTER: "? Demonstrate" Note that you receive the following results:

?Demonstrate #NULL# This is a string


 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; 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." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10 2.00 7.00

KBCategory: kbusage

KBSubcategory: TblFldp