Double entry

Discussions about CSEntry
Post Reply
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Double entry

Post 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
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Double entry

Post 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;
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Double entry

Post 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;
Post Reply