Microsoft KB Archive/149433

= How to Stop a Form from Loading =

Article ID: 149433

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 Q149433



SUMMARY
This article shows how to conditionally stop a form from loading based on the value of an expression by returning false (.F.) from an expression in the Init event of the form.



MORE INFORMATION
You can stop a form from loading if a variable or expression evaluates to false (.F.). For example, if you want to load an inquiry form based on a table called Students only if the table has records, place the following code in the Init event of the form: IF RECCOUNT("students")==0 =messagebox("No students have been entered",64,"Student table empty") RETURN .F.  ENDIF The Load event occurs, but the form is never instantiated.

Additional query words: VFoxWin

Keywords: KB149433

-

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

© Microsoft Corporation. All rights reserved.