Microsoft KB Archive/318902

= FIX: Visual FoxPro 7.0 Quits When You Run a Form with Grid =

Article ID: 318902

Article Last Modified on 10/19/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q318902



SYMPTOMS
When you run a form that has a grid control in the Visual FoxPro 7.0 (VFP7) development environment, VFP7 quits without an error message.



CAUSE
The ControlSource property of a control that the grid contains is set to a non-existent data source, and the Unload event of the form contains code.



RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:

  Date       Time    Version      Size    File name     Platform -  8-Mar-2002 13:30:01  9499      4.16MB   Vfp7.exe 8-Mar-2002 13:30:02 9499      1.09MB   Vfp7enu.dll



STATUS
Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro 7.0.



Steps to Reproduce the Behavior:
Paste the following code in a program (.prg) file, and then run the program from the Command window: LOCAL laForm[1], loForm AS FORM CD JUSTPATH(SYS(16)) CLOSE DATABASES ALL ERASE Q318902*.*

CREATE TABLE Q318902_dbf (cField1 C(10), cField2 C(10)) CREATE FORM Q318902_frm NOWAIT

ASELOBJ(laForm, 1) loForm = laForm(1) WITH loForm .ADDOBJECT(&quot;Grid1&quot;, &quot;Grid&quot;) .grid1.COLUMNCOUNT = 2 .grid1.RECORDSOURCE = &quot;Q318902_dbf&quot; .grid1.Column1.CONTROLSOURCE = &quot;Q318902_dbf.cField1&quot; .grid1.Column2.CONTROLSOURCE = &quot;Q318902_dbf.cField2Bad&quot; ENDWITH KEYBOARD '{ctrl+w}' DOEVENTS

MODIFY FORM Q318902_frm NOWAIT METHOD UNLOAD DOEVENTS KEYBOARD &quot;* Remove this line: form does not disappear.{CTRL+W}{CTRL+W}&quot; DOEVENTS

CLOSE ALL USE Q318902_dbf DO FORM Q318902_frm Observe that Visual FoxPro quits.

Additional query words: exit crash grid gone disappears

Keywords: kbbug kbfix kbqfe kbcodesnippet KB318902

-

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

© Microsoft Corporation. All rights reserved.