Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form's DataSession
Message
 
 
To
04/12/1997 10:56:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00063803
Message ID:
00063815
Views:
69
>>I have a menu system that has some choices that are only available if a certain condition exists in a private datasession of a form [e.g., !eof("MainTable")]. However, when the form is instantiated and the table is opened and displayed in a grid, the choice does not activate because the menu is still "looking" at the Default DS instead of the private DS established by the form (according to the VFP3 View window). If I manually switch to the Private DS in the View window, the menu item is now active.
>>
>>I know I can explicitly SET DS TO the DSID of the form, but it seems that with everything else VFP handles so elegantly (and automatically), this would have been handled as well. Or am I missing something?
>
>I guess, it's better to 'link' your menu with some oApp properties/methods, i.e. opening a form you run a method evaluating e.g. private datasession record pointers and resetting appropriate 'menu-control' properties.

In my Form subclass I have:
if ThisForm.DataSession=2
   Set DataSession to ThisForm.DataSessionID
endif
This code does fire when I run the app (I put a wait window nowait before EndIf). However, the DS "of record" does not change in the VF3 View Window and, consequently, the menu item is still disabled. I manually change to the private DS, and the item enables. Debugging shows the DSID to be 2 and the SET DS TO 2 fires without error but nothing changes.

Any ideas on what I have done wrong?
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform