Hello,
I need some help with automatic calculation.
I created a form with multiple record, one of the record is set to have max 3 occurrences.
In the record with max 3 occurrences, the first field is "Year". I would like the field "Year" of occurrence 1 to be automatically filled with the content of the field "Year" which is in the first record. Then "Year of occurrence 2 to be filled with the content of the field "Year" which is in the first record + 1, etc.
Is there an auto fill function and how do I code calculation?
Sorry for my bad english and thank you for any help.
Automatic calculation (auto fill function ?)
Re: Automatic calculation (auto fill function ?)
Somehow I found my way with the code below.
I'm not sure if this is the best way to do what I need.
Could I have an advice?
Thank you
**************************************
PROC Q62_ANREF
preproc
if not Q3_3_AOUVDOS = notappl then
impute (Q62_ANREF(1),Q3_3_AOUVDOS);
endif;
if not Q11B_ETATDOS = notappl then
impute (Q62_ANREF(2),Q3_3_AOUVDOS+1);
endif;
if not Q11C_ETATDOS = notappl then
impute (Q62_ANREF(3),Q3_3_AOUVDOS+2);
endif;
I'm not sure if this is the best way to do what I need.
Could I have an advice?
Thank you
**************************************
PROC Q62_ANREF
preproc
if not Q3_3_AOUVDOS = notappl then
impute (Q62_ANREF(1),Q3_3_AOUVDOS);
endif;
if not Q11B_ETATDOS = notappl then
impute (Q62_ANREF(2),Q3_3_AOUVDOS+1);
endif;
if not Q11C_ETATDOS = notappl then
impute (Q62_ANREF(3),Q3_3_AOUVDOS+2);
endif;
-
- Posts: 1796
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Automatic calculation (auto fill function ?)
You don't need to use the impute function. That function is in CSPro for batch editing programs and I can't think of a case in which it would necessary in a data entry application.
I do not completely understand your code, but it sounds like you could accomplish what you want to by writing something like this:
I do not completely understand your code, but it sounds like you could accomplish what you want to by writing something like this:
PROC Q62_ANREF
preproc
if Q3_3_AOUVDOS <> notappl then
Q62_ANREF(1) = Q3_3_AOUVDOS;
Q62_ANREF(2) = Q3_3_AOUVDOS + 1;
Q62_ANREF(3) = Q3_3_AOUVDOS + 2;
endif;
preproc
if Q3_3_AOUVDOS <> notappl then
Q62_ANREF(1) = Q3_3_AOUVDOS;
Q62_ANREF(2) = Q3_3_AOUVDOS + 1;
Q62_ANREF(3) = Q3_3_AOUVDOS + 2;
endif;
Re: Automatic calculation (auto fill function ?)
This is indeed much better.
Thank you.
Thank you.
Last bumped by Anonymous on September 23rd, 2011, 8:50 am.