Hello,
I have one question. I have one field (HH9) which record number of household members and a roster which has detail of each member. I want to put a logic in roster that show a listing depending on number of household members. I have attached the image file for referring.
Thanks,
Vanndy
Roster
Forum rules
New release: CSPro 8.0
New release: CSPro 8.0
-
- Posts: 47
- Joined: August 8th, 2012, 5:20 am
- Location: Pohnpei, Federated States of Micronesia
Re: Roster
Hello Vanndy,
I am not too sure on what you want the piece of code to do but me try to take a crack at it.
So, if you want the roster to end and skip to the next item outside the roster based on the number of contained within HH9 then use this piece of code.
I hope this helps. If this is not what you are looking for, explain what you want he code to do.
I am not too sure on what you want the piece of code to do but me try to take a crack at it.
So, if you want the roster to end and skip to the next item outside the roster based on the number of contained within HH9 then use this piece of code.
Code: Select all
PROC HL21
postproc
if HH9 = curocc() then
endgroup;
endif;
Re: Roster
Hello Pierrew,
Yes, It's help in this way. However I want to use another way by using loop to count base on the number of HH9 to show in the roster, and for the HL1 will be displayed those sequence number automatically and HL1 will be used property "Protected" prevent touching from data entry. I try to use it but it doesn't work. How can we do this?
Thanks,
Vanndy
Yes, It's help in this way. However I want to use another way by using loop to count base on the number of HH9 to show in the roster, and for the HL1 will be displayed those sequence number automatically and HL1 will be used property "Protected" prevent touching from data entry. I try to use it but it doesn't work. How can we do this?
Thanks,
Vanndy
-
- Posts: 47
- Joined: August 8th, 2012, 5:20 am
- Location: Pohnpei, Federated States of Micronesia
Re: Roster
If you want to protect the data item field to prevent your data entry operators from modifying the numbering sequence make sure that your valuesets for HL1 are complete. (crashing problems)
With that being said, there are two ways to auto number HL1. The easiest is to use auto numbering in the Field Properties (right click over the item field) ans select Sequential and Protected. The other option is to use this code.
By using the code above, HL1 will only get assigned a number if the active field is HL2 such as clicking into HL2 at any occurrence. So if your data entry operator is on the 5th occurrence of HL2 then HL1 will get assigned a numeric value of "5" at the 5th row.
Cheers!
With that being said, there are two ways to auto number HL1. The easiest is to use auto numbering in the Field Properties (right click over the item field) ans select Sequential and Protected. The other option is to use this code.
Code: Select all
PROC HL2
onfocus
HL1 = curocc();
Cheers!