Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi page access
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00400755
Message ID:
00400837
Views:
12
>>I have a form that has 3 pages and I need to force the user if he changed the value in a given field on page 1 (whether or not the user leaves this field) to go immediately into a given field on page 2.
>>
>>Basically I'm looking at a forced tab but jumping a few object.
>>
>>I have tried using setfocus to no avail.
>>
>>I understand that I could move the page2.field on page 1 but I rather not.
>>
>>TIA
>>
>>Pierre Richard
>
>oForm.PageFrame.ActivePage=2
>oForm.PageFrame.Page2.YourControl.SetFocus()

You didn't say which method of which event you would put this code into!

The question now becomes: "How do you detect the change of a value in a field if the 'valid' or 'lost focus' event is not triggered by the 'Enter' or 'Tab' key?" Normally, the 'Enter Key' (chr(13)) or 'Tab' (chr(9)) tells the system that the entry process is complete and to accept the value. If the user leaves the field then the 'lost focus' event is the place to put the test to determine if the value has changed. But, the original question reqires the change be detected without necessarily leaving the field!

The KeyPress event may be the tool, but I'm not sure how to use it for this problem. On entry into the textbox (via either 'when' or 'get focus') the contents of the field is copied to a form property. The 'select on entry' property of the field is turned off, otherwise the value could be changed with the touch of any key, intentional or not. Just arrowing through the characters in the field isn't changing them so it shouldn't trigger the code to change the active page. But, suppose the user intends to change the value but requires several keystrokes to do so? The first keystroke which renders the contents of the textbox different from the original value still leaves the question of determining when the user changes are complete. Unless the Pierre intends that the code to change active page is fired if a single character changes I see no solution to the second problem.
Anyone else?
Nebraska Dept of Revenue
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform