ACC1x: GPF Using Invalid IIf() As Control Source

Last reviewed: May 28, 1997
Article ID: Q96993
The information in this article applies to:
  • Microsoft Access version 1.0

SYMPTOMS

If you use the IIf() function as the ControlSource property of a form or report and do not provide the necessary parentheses around the parameter list, Microsoft Access may cause a general protection (GP) fault instead of returning an error message.

For example, the following syntax is incorrect and will cause a GP fault:

   =IIf IsNull([Fld]),"NULL","NOT NULL"

Note that the parentheses for the IIf() function are missing. As soon as you try to leave the property setting, the GP fault will occur.

RESOLUTION

Ensure that all IIf() functions include the required parentheses around the parameter list. The following syntax is a corrected version of the one displayed above:

   =IIf(IsNull([Fld]),"NULL","NOT NULL")

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 1.0. This problem was corrected in Microsoft Access version 1.1.


Keywords : ExrOthr kbusage
Version : 1.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : Info_Provided


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: May 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.