Skip to main content

[archive] moving control around to different fields

  • December 2, 2006
  • 4 replies
  • 0 views

[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.

4 replies

[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.
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.

[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.
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

[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.
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

[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.
Thanks for the help.