This article was previously published under Q128156
This article has been archived. It is offered "as is" and will no longer be updated.
Under program control, the 'Invalid Data Type for This Property' error isreturned when an object is instantiated or a form is executed.
The value entered for the property is of the wrong type. This error islikely to occur with properties that evaluate data. For example, theCONTROLSOURCE property specifies the source of data for a control. Thecontrol being defined determines what type of data can be used. However,the CONTROLSOURCE property only accepts character strings. For example,
This.ControlSource= RECNO() && Returns the "Invalid Data Type" error This.ControlSource="RECNO()" && Correct setting for this property
Ensure that you are using the correct type for the expression you enter.
This behavior is by design.
The following is a partial list of properties that accept character datathat may evaluate to another type. For more information, please refer tothe FoxPro Help menu.