Highlighted
Absent Member.
Absent Member.
783 views

[archive] moving control around to different fields

[Migrated content. Thread originally posted on 01 December 2006]

I have a problem with a screen display. We have a search field that accepts last name then a push button to search. If after pressing the push button the search is invalid, how do I return control to the entry field for the search. Currently the control stays on my push button. I have added the following after the invalid read has completed:

move 11 to control-id
move 4 to accept-control
move 1 to control-value

With 11 being the control-id of the entry field.
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] moving control around to different fields

I assume you are using screen section? Individual accepts will do no good in this case.
Also note that this technique does not apply for event procedures, you should use an after or exception procedure for this.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] moving control around to different fields

after tracing the program several times I found the problem. When the error occurs on the read statement we call in another program to display a message. Upon return to the current program in one of the acu-bench routines it is moving 1 to accept-control which is current field. I am not sure how to get around it but will work on it more.

thanks
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] moving control around to different fields

I ran into this situation as well and as Gisle stated, you need to change your push button control from being an event procedure to either an after or an exception procedure, then setting what you are doing will work. It took me a lot of time and expiermenting to discover this as well.
You can use the Control-Value if you know the tab position on the screen and it will go there during an event procedure, but it can be real tricky figuring that out if you have a series of frames or tabs on the screen. If you don't have any frames or tab controls, then you can simply look at the tab value for the control you want to go. You have to be careful with this though, if you change or add fields to your screen, the tab value may change and you have to remember to go back into your code and change it as well.

Steve
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] moving control around to different fields

Thanks for the help.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.