Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locate record in Another Form on Private Session?
Message
 
 
To
08/06/1998 10:20:05
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00105702
Message ID:
00105807
Views:
19
>>What about SET DATASESSION To formb.datasessionid and then LOCATE/SEEK...
>>You can fire it from KeyPress event to catch 'F2'.

Ed....

Recommending anybody doing this is extremely dangerous - at least without taking the proper precautions and understanding the ramifications of doing a Set DataSession To - perhaps the most dangerous thing to do in VFP. Specfically, if you do a Set DataSession To in a form with bound controls in a different private data session - that form's bound controls are toast. Rather, you need to pass the data session around. So, in this case, you would have form 1 pass its datasession ID to form 2, form 2 would then do a set datasession to the datasession that was passed. This should be done in the Load(). So, it is a good idea to have a custom property of the form that would hold this passed data session ID. Prior to passing control back to another form - it is necessary to get back to the calling form's private data session first. Otherwise, the bound controls will be toast.

Other approaches include creating a FormSet. Multiple forms can then have access to the same private data session. Another alternative is to have form 2 modal with the datasession setting to Default. In this case, Form2 will inherit Form1's private data session.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform