Page 1 of 1

Double entry

Posted: February 2nd, 2016, 8:04 am
by MrTaco
Hi Guys

I want to make my Control Number or Household twice for surety or security.

i.e 1. control number in the beginning is 500023, then at the of the questionnaire they should enter the same, if they don't it should show "error message"

Thabiso

Re: Double entry

Posted: February 3rd, 2016, 6:50 am
by josh
Add a second control number field to your dictionary and drop it onto the form at the end of the questionnaire. Then in the postproc of the second control number field compare the two values and call errmsg if they are not the same:

Code: Select all

if CONTROL_NUMBER <> CONTROL_NUMBER_CHECK then
    errmsg("Control numbers do not match");
endif;

Re: Double entry

Posted: February 3rd, 2016, 11:49 am
by Gregory Martin
You will likely want to reenter the field after displaying the error message, so the complete logic may look like this:
PROC CONTROL_NUMBER_CHECK

    
if CONTROL_NUMBER <> CONTROL_NUMBER_CHECK then
        
errmsg("Control numbers do not match");
        
reenter;
    
endif;