ACC2: SQL Statement in Macro Condition Causes GP FaultID: Q119807
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you run a macro that has an SQL statement as part of a conditional
expression, you may receive a general protection (GP) fault.
Use the DLookup() function, or a user-defined function, instead of an SQL statement to return the value to be used in the conditional expression.
Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This behavior no longer occurs in Microsoft Access version 7.0.
SQL statements cannot be used in expressions within macro conditions. You must instead use a function that only returns one value.
Table: Table1
--------------------
Field Name: Field1
Data Type: Number
Macro Name Condition Macro Action
-----------------------------------------------------------
Macro1 (Select Field1 from Table1;)>1 Beep
Microsoft Access "User's Guide," version 2.0, Chapter 24, "Using Conditions
in Macros," pages 620-623
For more information about using conditions in a macro, search for
"Conditions," and then "Using Conditions in a Macro" using the Microsoft
Access Help menu.
Additional query words: gpf
Keywords : kberrmsg kbusage McrCond
Version : 2.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 6, 1999