ACC: Objects Cannot Be User-Defined Data Type Elements

Last reviewed: June 8, 1997
Article ID: Q96420
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0

SYMPTOMS

Advanced: Requires expert coding, interoperability, and multiuser skills.

When you attempt to use a Microsoft Access defined object data type as a user-defined data type element, you may receive the following error message:

   Expected: Integer or Long or Single or Double or Currency or String
   or Variant or Identifier.

CAUSE

Objects predefined by Microsoft Access are not supported as user-defined data type elements.

STATUS

This behavior no longer occurs in Microsoft Access version 7.0.

MORE INFORMATION

Microsoft Access defines eight object data types: Control, Database, Dynaset, Form, QueryDef, Report, Snapshot, and Table. You can use the Type statement in the Declarations section of a module to define your own data type. The user-defined data type cannot be one of the eight predefined data types.

Steps to Reproduce Behavior

  1. Create a new module.

  2. In the Declarations section, attempt to define a structure as follows:

          Type ControlInfo
    
            Ctl as Control
          End Type
    
    

  3. From the Run menu, choose Compile All. Note that you receive the error message mentioned earlier in this article.

REFERENCES

For more information, search for "Type Statement," and then "Object Data Types" using the Microsoft Access Help menu.

Microsoft Access "Introduction to Programming," version 1.0, Chapter 5, "Variables, Constants, and Data Types," page 43


Keywords : kbprg PgmDecl
Version : 1.0 1.1 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : kbfix


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