Hello.-
Is there any way I can disable a field so that it's only accesable by going backwards after the first time it's filled?
I've tried many ways to go around this, including using the previous and following field to sort of "make" a loop that enables fields when going backward and so on so forth, but so far I haven't been able to be succesful.
In short, imagine these are three fields filled by Person A
FIELD_1 -> FIELD_2 -> FIELD_3
What I want to do is, after the first time FIELD_2 is completed, you can only modify FIELD_2 by going backwards from FIELD_3
FIELD_1 -> FIELD_3 -> FIELD_2 (Only if you press the back key)
FIELD_1 ----X-----> FIELD_2
I've tried using noinput, and all sort of entry order procedures to make it behave like that, but so far haven't been succesful.
Any thoughts?
Thanks.
Modify fields only by going backwards
Re: Modify fields only by going backwards
The key to this is knowing that the preproc only runs when moving forward. So you can write something like this:
preproc
if FIELD_2 = notappl then // or "" for strings
noinput;
endif;
When moving forward the field is advanced through (not skipped) if not empty. When moving backwards the preproc won't run, so you'll enter FIELD_2.if FIELD_2 = notappl then // or "" for strings
noinput;
endif;
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Modify fields only by going backwards
You can also conditionally protect the field:
PROC FIELD_2
preproc
numeric moving_forward = true;
onfocus
if moving_forward and visualvalue(FIELD_2) <> notappl then
protect(true);
else
protect(false);
endif;
moving_forward = false;
preproc
numeric moving_forward = true;
onfocus
if moving_forward and visualvalue(FIELD_2) <> notappl then
protect(true);
else
protect(false);
endif;
moving_forward = false;