ACC1x: GPF Using Invalid IIf() As Control Source

ID: Q96993


The information in this article applies to:


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          : kbusage ExrOthr 
Version           : 1.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: March 20, 1999