Microsoft KB Archive/150467

= PRB: Modal Form Flickers When Exiting Form with DBGrid Control =

Article ID: 150467

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q150467



SYMPTOMS
Under certain circumstances, unloading a form containing a DBGrid control causes Visual Basic to hang and other open forms to flicker. After hiding the third form of the program, the second form flickers or blinks. Under the 16-bit edition of Visual Basic, an application error follows the blinking, and displays the following error message:

VB caused a general protection fault in module VB.EXE at 000b:000039f3.



CAUSE
The problem is limited to the following combination of circumstances:


 * A project contains at least three forms with each form containing the DBGrid control.
 * The first form shows a second, modal form. The problem does not occur if the second form is not shown modally.
 * A single form creates two or more instances of the original form.



RESOLUTION
There are two possible resolutions to the problem. Either solution prevents the problem from occurring:

 Do not show the second form as a modal form. - or -

  In the Unload event of the third form, add the following line of code: Me.Enabled = False 



STATUS
This behavior is by design.



Steps to Reproduce Problem
 Create a Visual Basic project with three forms.  Add a Command button to Form1. Place the following code in the Click event of the Command button: Form2.Show 1 </li>  Add a Command button to Form2. Place the following code in the Click event of the Command button: Form3.Show 1 </li> Add a DBGrid control to Form3. Run the project.</li> From Form1, click the Command button to show Form2. From Form2, click the Command button to show Form3. Close Form3.</li></ol>

Additional query words: 4.00 vb4win vb4all

Keywords: kbprb KB150467

-

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

© Microsoft Corporation. All rights reserved.