General information
Category:
Forms & Form designer
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only