PRB: "Data type mismatch" Error When Running a Form

Last reviewed: October 25, 1995
Article ID: Q138504
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0

SYMPTOMS

One of the following error messages appears when running a form:

  • Data type mismatch.

    -or-

  • Error loading file - ControlSource - record number #. Data type is invalid for this property.

CAUSE

The memory variable created by the ControlSource property of one or more objects on the form is the same as the memory variable that refers to the form.

RESOLUTION

Either rename the form, or change the ControlSource value to something other than the name of the form.

STATUS

This behavior is by design.

MORE INFORMATION

All memory variables must be unique. When a form is run, a memory variable is created that has the same name as the form. When the ControlSource of an object evaluates to a memory variable, Visual FoxPro attempts to create a memory variable. Because a memory variable of the same name already exists, Visual FoxPro produces the error.

Steps to Reproduce Behavior

  1. Create a form called myform.

  2. Add a combo box.

  3. Set the ControlSource property of the combo box to myform.

  4. Run the form.


Additional reference words: 3.00 VFoxWin
KBCategory: kbprg kbprb
KBSubcategory: FxotherGeneral


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: October 25, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.