Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active form is not an object
Message
 
To
28/09/1996 12:53:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00008736
Message ID:
00008812
Views:
36
Hi Michel,

Are you by any chance using this to enable/disable a menu option (in a SET SKIP OF)? (s)

ActiveForm will obviously fail if no form is active, so you have to specifically code for that instance by checking whether _SCREEN.ActiveForm is an object:

IF TYPE("_SCREEN.ActiveForm")="O" AND !ISNULL(_SCREEN.ActiveForm)

... do whatever here
ENDIF

This type of code is crucial if you have toolbar events that fire on forms that are expected to be open. My guess is that somewhere in your code a menu option is not disabled when there's no form active.

VFP 5.0 has a forms collection that makes this a little cleaner to deal with.

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform