Creating a dynamic valueset

Discussions about CSEntry
Post Reply
sham
Posts: 71
Joined: February 3rd, 2022, 7:30 pm

Creating a dynamic valueset

Post by sham »

Hello Family,
Let say a have 4 variables, J1_1, J1_2, J1_3, J2

Var1: J1_1 asked to make a 1st choice from a list of crops.....(single select)

crops: 1 Maize
2 Soy
3 Groundnut
4. Beans


Var2 : J1_2 asked to select the 2;d most important crop,,,,.....(single select)

Var3: J1_3 Asked for the 3rd choice ,,,,.....(single select)

Var4 J2: This variable also asked among the 3 which one is the main crops.
So i needed a guided so that after making the 1st 3 choices from (J1_1, J1_2 and J1_3) in J2 i should see only the option selected previously in J1_1, J1_2 and J1_3 respectively.... instead of bringing all the list.
I attached the Cspro program file for your attention.

I will be very glad for your help family.

Thanks
Sham.
You do not have the required permissions to view the files attached to this post.
etuser
Posts: 99
Joined: September 3rd, 2019, 5:57 am

Re: Creating a dynamic valueset

Post by etuser »

Hi Sham,

I tried to modify your program, please see the attached file .
You do not have the required permissions to view the files attached to this post.
sham
Posts: 71
Joined: February 3rd, 2022, 7:30 pm

Re: Creating a dynamic valueset

Post by sham »

@etuser
Thanks so much for giving me an alternative...

But still hoping from others if its possible to still maintain the initial structure that will be super.
ares
Posts: 16
Joined: January 29th, 2022, 7:54 am
Location: Yaounde

Re: Creating a dynamic valueset

Post by ares »

Hi Sham

I just copy the logic that is what I propose to you (as i used 7.5)
//////////////////////////////////////////////////////////////////////
PROC J2
//for this one you can put the valueset of the previous variables
onfocus
valueset J2_VS;
J2_VS.add(J1_1_VS1, J1_1);
J2_VS.add(J1_2_VS1, J1_2);
J2_VS.add(J1_3_VS1, J1_3);
setvalueset(J2, J2_VS);
//following line is not necessary if you put the capture type pf this field
setproperty(J2,"CaptureType", "RadioButton");
//////////////////////////////////////////////////////////////////////
//But you may need to drop already choosen modalities in J1_2 an J1_3
//////////////////////////////////////////////////////////////////////
PROC J1_2
//Make sure you remove what was in J1_1.
//Eventhough I don't see option no second crop
Onfocus
valueset J1_2_VS = J1_2_VS1;
J1_2_VS.remove(J1_1);
setvalueset(J1_2, J1_2_VS);

PROC J1_3
//Make sure you remove what was in J1_1 and J1_2.
//Eventhough I don't see option no third crop
Onfocus
valueset J1_3_VS = J1_3_VS1;
J1_3_VS.remove(J1_1);
J1_3_VS.remove(J1_2);
setvalueset(J1_3, J1_3_VS);
sham
Posts: 71
Joined: February 3rd, 2022, 7:30 pm

Re: Creating a dynamic valueset

Post by sham »

Thanks soo much ares.
May God bless all of you for your lovely comments.

May Allah continue to bless this family with more knowledge and Good health.

Thanks.
Sham
Post Reply