Hi again
So, my application has a single household record, a multiple roster record and then a multiple woman record. I have a household form with the roster, and then the woman form which displays as single forms and can have up to five occurrences. In between the household form and the woman form I've added a "return" form which is only gone to when demode()=Modify i.e. it enables the household form to be skipped if the user is re-opening a case. On this return form the user can enter a number into a field which is the ID of the woman, and I'm then trying use seek to go to the woman record occurrence which has that ID number. Except that I can't get it to work. Say that the field on the return form into which the ID is entered is called RETURN_FIELD, and I want to skip to the WOMAN_STATUS field of the occurrence which matches the ID number that has been entered. I've used:-
PROC RETURN_FIELD
postproc
numeric womid=$;
skip to WOMAN_STATUS(seek(WOMAN_ID=womid));
But no joy so far. What am I doing wrong?
Thanks
Keith
Problem with seek function
-
Gregory Martin
- Posts: 1947
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Problem with seek function
I think the problem here is similar to what you experienced with the show function earlier. Until the path of your program has passed the WOMAN_ID field, those values will appear to your program as notappl, so the seek function isn't going to return the row where WOMAN_ID = womid. You can find the right row using a loop:
numeric occ;
do occ = 1 while occ <= count(WOMAN_ID)
if visualvalue(WOMAN_ID(occ)) = womid then
skip to WOMAN_STATUS(occ);
endif;
enddo;
do occ = 1 while occ <= count(WOMAN_ID)
if visualvalue(WOMAN_ID(occ)) = womid then
skip to WOMAN_STATUS(occ);
endif;
enddo;