PRA: Wrong Action Query Icon with CreateQueryDef Method

    Article ID: Q105654
    Creation Date: 22-OCT-1993
    Revision Date: 19-SEP-1996

    The information in this article applies to:

    • Microsoft Access versions 1.0 and 1.1

    SYMPTOMS

    The exclamation point (!) that identifies an action query icon in the Database window is missing from action queries that are created with the CreateQueryDef method.

    CAUSE

    The query icon that is displayed is determined by flags stored separately from the query itself. When a query is created with the CreateQueryDef method, the flags are set for the default icon instead of for the action query icon.

    RESOLUTION

    Open the query in Design view from the Database window. Then, save the query (without making any changes to it). The correct icon will be displayed.

    STATUS

    Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

    MORE INFORMATION

    This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual.

    Steps to Reproduce Problem

    1. Open the sample database NWIND.MDB.
    2. Create a new module.
    3. Enter the following code in the module:

      NOTE: In the following sample code, an underscore (_) is used as a line- continuation character. Remove the underscore when re-creating this code in Access Basic.

            'Place the following Option line in the Declarations Section
            Option Explicit
      

            Sub WrongIcon ()
               Dim MyDB As Database, MyQuery As QueryDef
               Set MyDB = CurrentDB()
               Set MyQuery = MyDB.CreateQueryDef("Wrong Icon", "SELECT * _
                  into SomeTable FROM Customers;")
               MyQuery.Close
               MyDB.Close
            End Sub
      
    4. From the View menu, choose Immediate Window.
    5. Type the following, and then press ENTER:

            WrongIcon
      
    6. Select the Database window. Note that the icon for the newly created query WrongIcon displays the default icon rather than the action query icon.

    REFERENCES

    Microsoft Access "Language Reference," pages 90-91

    Microsoft Access "User's Guide," pages 161-163


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.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.

Additional reference words: 1.00 1.10 AB ADK
KBCategory: kbusage
KBSubcategory: QryOthr