Multiple value sets

Discussions about CSEntry
Post Reply
quicnsereko
Posts: 9
Joined: February 24th, 2015, 12:51 am

Multiple value sets

Post by quicnsereko »

Hello, I have a column (main variety) in the roster whose values are different depending on crop chosen in previous question which is not in the roster. Could you help me with this. Thanks
Attachments
variety.PNG
variety.PNG (13.71 KiB) Viewed 5356 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Multiple value sets

Post by josh »

You can define multiple value sets for the main variety variable in the dictionary and then use the command setvalueset() from logic to change the value set based on the crop chosen. setvalueset() is usually used in the onfocus proc so your logic would look something like:

Code: Select all

PROC MAIN_VARIETY
onfocus
if CROP = 1 then
  setvalueset(MAIN_VARIETY, MAIN_VARIETY_VS_MAIZE);
elseif CROP = 2 then
  setvalueset(MAIN_VARIETY, MAIN_VARIETY_VS_BEANS);
etc...
quicnsereko
Posts: 9
Joined: February 24th, 2015, 12:51 am

Re: Multiple value sets

Post by quicnsereko »

Worked perfectly, Thanks
Post Reply