Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataEnvironment for pageframe within a pageframe
Message
 
To
24/07/1997 13:42:02
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00041498
Message ID:
00041509
Views:
29
>I have created a baseform with a 1st level pageframe on it, within each of these pages I have added 2nd level pageframe. Is there a way to seperate the DataEnvironment by each of the 1st level pageframe tabs which will control the environment of the 2nd level forms? Currently, when I run the form the oApp.Toolbar. moves the 1st level records when next or whatever is pressed, I want to have the toolbar move the records for the 2nd level displayed form. I know it may sound silly, but I can create a single form with the user just selecting the tabs instead of dropdown menus.
>
>Thanks in advance.
>Brian Machtolff

Hi Brian,
According to what you say, there is a hook of the dataenvironment which is controlling the record movement for previous, next etc. from the toolbar. Say you have a property called oDataEnvironment on the form which is a reference to the dataenvironment of the main form. Now if you want to control the other DataEnvironment just before your previous next methods you could have

*-- Change the reference of DataEnvironment
thisform.oDataEnvironment = 'Your Pageframe's environment'

Do the previous, next, save, delete, discard, new etc...

*-- Reset the reference
thisform.oDataEnvironment = 'Form level DataEnvironment'

Good Luck,
Kamal

ps : If you require the toolbar to work for both you could create a custom DataBehaviour class which has all the method code and the toolbar calls the methods of this class. So in your case if you want to control 2 DataEnvironments you will drop 2 instances of these on your form
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform