Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form designer
Message
From
17/06/1997 15:46:15
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00036648
Message ID:
00036696
Views:
44
>>>>I created a form, a data entry screen, for entering survey data. It has a few pages. When I tried to set a control to skip pages, say go to page 6 from page 2, my program freezed. I do not know how to fix this problem.
>>>>
>>>I don't completely understand what you mean *set a control to skip pages*,
>>>but if you say, have a button on Page 2 with the code in Click event:
>>>
>>>this.parent.parent.ActivePage = 6
>>>
>>>it should work.
>>>
>>>Nick
>>
>>
>>Thanks a lot, Nick. I tried your code on page2 in click event and got a error message saying 'avtivepage not found'. Let me explain more about my problem.
>>In page 2 I have a screen somehting like this:
>>
>> Have you ever hear of radon? a. Yes O
>> b. No O
>>
>>
>>Yes/no is a option group. If the YES box is checked it should go to page 3, and if the NO box is checked it should go to page 6.
>
>Probably you have the problem with object referencing. Activepage is the property of Pageframe.
>
>If you have Optiongroup on page 2
>you put in Option1.Click()
>
>this.parent.parent.parent.ActivePage = 3
>
>and in Option2.Click()
>
>this.parent.parent.parent.ActivePage = 6
>
>
>You can also this code in InteractiveChange event:
>
>DO CASE
>CASE this.Value = 1 && Yes is checked
>this.parent.parent.ActivePage = 3
>CASE this.Value = 2 && No is checked
>this.parent.parent.ActivePage = 6
>ENDCASE
>
>but in your case better to use the Click event in Option1... etc.
>because, for example, Option1 is default option and if you click on it
>there is no change for OptionGroup.Value.
>
>I sent you the sample form RADON.SCX by E-mail.
>
>Nick

Also note: setting the pageframe.activepage brings the said page to the front, but neither sets the focus nor (curiously) triggers the pages activated code. This took me a bit to figure out what is going on, but I have found that the needed code goes more like:

this.parent.parent.parent.activepage = 3
this.parent.parent.parent.page3.activate
this.parent.parent.parent.setfocus

HTH
Erik
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform