How to Add 12 Months on form with check box

Dear all

I want to add 12 month multiple Selection on form .while selection month how many month has been selection and count the month , so i can calculate further calculation.

Pls provide me C/side code .for the same.

e.g. Jan

feb

mar

in check box

if i select jan and feb ,it should count 2

Please Advice

Thanks in advance

Pandurang

Hi Pandurang,

Could you please explain exactly what it that you’re trying to do. I really don’t understand what you’ve been writing here?

var : months[12] - boolean
i - integer
count - decimal

make checkbox - assign it with months[1] for January, next checkbox - assign it with months[2] for February, and so on.

count := 0;
for i = 1 to 12 do
if months [ i ] = TRUE then count += 1;

that’s the idea.

Looks good Joe, but I still don’t understand what it is that this should be used for.

Eric, not sure also what’s his purpose. But I just giving the pseudo-code. [:)]

Hi Erik & joe,

Maybe he is creating some thingey where a user can split a cost over x months, and at the same time give the user possibility to, at runtime, define wich months it should be split into.

NB!
Instead of doing a loop to calculate “count”, he could also keep track of it when validating month[x].
This would call for code to be put in more places, but will on the other hand let “count” be available at any time.

Hello,

Thanks to all for giving me your valueable time .

Hi Erik & joe,

I am Developing Student Fees Colleciton form for primary school . so i created one array variable for 12 month and put 12 checkbox on form and sourceExpr give as cMonthArray[1],cMonthArray[2],cMonthArray[3] …etc, and set caption of January,February,March …etc.

for e.g. Student given two month fees then user can click on january and february … so when user save the record i am making one string for all selected month in this case - January,February and stored in fmonthname field.

my problem is …now when user click next , previous button then checkbox should make true automatic for respective month. from reading the fmonthname field.

Thanks

Pandurang