Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Events Order Problem
Message
From
02/05/2000 13:13:21
 
 
To
02/05/2000 11:25:22
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00365110
Message ID:
00365176
Views:
14
>I have a form (FormA) and in the init of FormA it fires off another form (FormB). The init method of FormB calls a method in a class which is placed on FormB. I am getting an error that it cannot find the method in the class which is on the FormB. I believe that this is from the fact that the forms are not completely initialized at that point. Is there a way around this problem? Can I create a method that gets called after the forms completely initialize?
>
>TIA

Quinn,

Let me see if I have this straight ...

You init FormA
FormA.Init inits FormB
FormB contains an object
The init of FormB attempts to access a method of the object

Is this the correct sequence of events ???

This type of problem is the evidence for my argument that all methods should return some value indicating success or failure.

I would suggest stepping through the code from the Load event of FormA and watch when things happen.

You are likely to find one or both of two problems.
One as Cetin mentioned, the method may be private to the object.
Two, the object may be out of scope at the point the method call is made. One way to tell for sure is when the debugger pops up, go to the watch window and type in [FormB.(Object).Name], where (Object) is the object in question. At the point where you type it in, it should say (Unable to Evaluate) ... If it says (Unable to Evaluate) at the point where the method call is made, the object is out of scope.

That said, as a rule I don't load forms from other forms. If I had a case where I always wanted both forms loaded simultaneously, I would do so from procedure code in the menu call.

DO FORM FormA
DO FORM FormB

Just my 2 krupplenicks worth ...

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform