PRB: ERROR "<formname> not an object" When Accessing FormID: Q129402 3.00 WINDOWS The information in this article applies to:
SYMPTOMSAccessing a form causes the error message "Unknown member <formname>" to be displayed.
CAUSEIf a form is modal, the program pauses when it's displayed. A common reaction is for the user is to close the form to allow the program to continue execution. However, if the code that subsequently runs refers to any properties of the form, the error message is displayed because the form is out of scope (closed).
WORKAROUNDThe WindowType property controls whether the form is modeless (the default) or modal. Setting the WindowType property for the form or formset in the DEFINE CLASS code to 0 (zero - modeless), or not including the WindowType property (causing a default of 0) resolves the problem.
STATUSThis behavior is by design.
MORE INFORMATIONBecause they are modal, the program below pauses after the two forms appear. When the forms are closed, the program will continue after the FrsMyset.show command. However, because the forms are closed, the error "Unknown member FRMMYFORM1" is displayed.
The WindowType property controls whether the form is modeless
(the default) or modal. If the form is modal, the user must close
the form before accessing any other elements of your application's
user interface (see below).
WindowType
Removal of the WindowType property (or setting it to 0) in the class
definition allow the windows to be modeless and thus allow program
execution to continue after the windows are displayed.
Additional reference words: 3.00 VFoxWin model errmsg window KBCategory: KBSubcategory: FxtoolFormdes
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |