Microsoft KB Archive/150596

= FIX: Error Message "Variable is Not Found" When Running Form =

Article ID: 150596

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q150596



SYMPTOMS
When you run a form with a grid on it, the error message "Variable Is Not Found" appears. If you click OK, the form is displayed but the grid is empty. If you close the form and run it again, the error is not displayed. However, the grid is still empty.



CAUSE
The ControlSource property of the grid columns is set to a table field that is not open.



WORKAROUND
Open the table before running the form or add the table to the DataEnvironment of the form.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.



MORE INFORMATION
This behavior occurs because the grid columns have a ControlSource set to a field that cannot be found because the table has not been opened.

Steps to Reproduce Problem
 Create a new form. Add the Customer table from the \VFP\Samples\Data directory to the DataEnvironment of the form. Drag the Cursor object from the DataEnvironment and drop it on the form to create a grid. Set the following properties for the grid:

Grid1.ColumnCount = 2

Grid1.Column1.ControlSource = Cust_id

Grid1.Column2.ControlSource = Company

 Save and run the form. Note that the grid has information in it. Close the form and modify it.</li> Open the DataEnvironment, and delete the Cursor1 object. Save and run the form.</li> The error "Variable Is Not Found" is displayed.</li> Click OK, and the form is displayed but the grid is empty.</li></ol>

NOTE: If you close the form and run it again, you do not see the error message, but the grid is still empty. Running the form after exiting and restarting Visual FoxPro causes the error message to be displayed.

Keywords: kberrmsg kbbug kbfix kbvfp500fix KB150596

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.