End If vs. ElseIf

# Thread: End If vs. ElseIf

1. Senior Member
Join Date
Dec 1969
Posts
2,238

## End If vs. ElseIf

Would it be better if I used End If statements between each If statement?<BR><BR> myMail.From = fromWho<BR> if checkbox4 ="1" AND InStr("219,317,765,812,413,508,617,781,978,207,231 ,248,278,313,517,586,616,679,734,810,906,947,989,6 03,315,516,518,607,631,716,914,216,234,330,419,440 ,513,614,740,937,802,262,414,608,715,920", areacode) &#062; 0 Then<BR> myMail.To = strRecipListA<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox4 ="1" AND InStr("203,475,860,959,201,609,732,856,908,973,212 ,347,646,718,917,215,267,412,484,570,610,717,724,8 14,878,401") then<BR> myMail.To = strRecipListB<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox4 ="1" AND InStr("219,317,765,812,202,302,305,321,352,407,561 ,727,786,813,850,863,904,941,954,270,502,606,859,2 40,301,410,443,212,347,646,718,917,423,615,865,901 ,931,540,571,703,757,804,304", areacode) &#062; 0 Then<BR> myMail.To = strRecipListC<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox4 ="1" AND InStr("501,870,218,320,507,612,651,763,952,314,417 ,573,636,660,816,701,308,402,605,210,214,254,281,3 61,409,469,512,682,713,806,817,830,832,903,915,936 ,940,956,972,979", areacode) &#062; 0 Then<BR> myMail.To = strRecipListD<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox4 ="1" AND InStr("205,256,334,404,678,706,770,912,217,224,309 ,312,618,630,708,773,815,847,316,785,913,225,318,3 37,504,228,601,662,252,336,704,828,910,919,980,405 ,580,918,803,843,864", areacode) &#062; 0 Then<BR> myMail.To = strRecipListE<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox4 ="1" AND InStr("907,480,520,602,623,209,213,310,323,369,408 ,415,424,510,530,559,562,619,626,627,628,650,657,6 61,707,714,760,805,818,831,858,909,916,925,935,949 ,303,719,720,970,808,208,406,505,702,775,503,541,9 71,435,801,206,253,360,425,509,564,307", areacode) &#062; 0 Then<BR> myMail.To = strRecipListF<BR> myMail.Subject = "Monitor Selected"<BR> elseif checkbox = "" AND checkbox2 = "" AND checkbox3 = "" AND checkbox4 = "" AND checkbox5 = "1" AND checkbox6 = "" AND checkbox7 = "" AND checkbox8 = "" AND checkbox9 = "" AND checkbox10 = "" AND checkbox11 = "" Then<BR> myMail.To = strRecipListG<BR> myMail.Subject = "Public Oppinion Polling Selected"<BR> elseif checkbox11 ="1" then<BR> myMail.To = strRecipListH<BR> myMail.Subject = "DTC / Script Selected"<BR> elseif checkbox4 ="0" AND InStr("501,870,480,520,602,623,303,719,720,970,219 ,317,765,812,217,224,309,312,618,630,708,773,815,8 47,219,317,765,812,316,785,913,270,502,606,859,225 ,318,337,504,218,320,507,612,651,763,952,314,417,5 73,636,660,816,228,601,662,701,308,402,505,405,580 ,918,605,423,615,865,901,931,210,214,254,281,361,4 09,469,512,682,713,806,817,830,832,903,915,936,940 ,956,972,979,262,414,608,715,920", areacode) &#062; 0 Then<BR> myMail.To = strRecipListI<BR> myMail.Subject = "Monitor NOT Selected"<BR> elseif checkbox4 ="0" AND InStr("907,209,213,310,323,369,408,415,424,510,530 ,559,562,619,626,627,628,650,657,661,707,714,760,8 05,818,831,858,909,916,925,935,949,203,475,860,959 ,202,808,208,406,201,609,732,856,908,973,702,775,2 12,315,347,516,518,607,631,646,716,718,914,917,503 ,541,971,435,801,206,253,360,425,509,564,307", areacode) &#062; 0 Then<BR> myMail.To = strRecipListJ<BR> myMail.Subject = "Monitor NOT Selected"<BR> elseif checkbox4 ="0" AND InStr("205,256,334,302,305,321,352,407,561,727,786 ,813,850,863,904,941,954,404,678,706,770,912,413,5 08,617,781,978,240,301,410,443,207,231,248,278,313 ,517,586,616,679,734,810,906,947,989,252,336,704,8 28,910,919,980,603,216,234,330,419,440,513,614,740 ,937,215,267,412,484,570,610,717,724,814,878,401,8 03,843,864,540,571,703,757,804,802,304", areacode) &#062; 0 Then<BR> myMail.To = strRecipListK<BR> myMail.Subject = "Monitor NOT Selected"<BR> elseif Request.Form("type") = "PS" then<BR> myMail.To = "ccariri@yankelovich.com"<BR> myMail.Subject = "Products and Services Contact Us Form Submit"<BR> elseif Request.Form("type") = "TA" then<BR> myMail.To = "webmaster@yankelovich.com"<BR> myMail.Subject = "Technical Assistance Contact Us Form submit"<BR> else<BR> myMail.To = "ccariri@yankelovich.com"<BR> myMail.Subject = "Products and Services Contact Us Form Submit / Other"<BR> end if