If Then statements

Results 1 to 2 of 2

Thread: If Then statements

  1. #1
    Join Date
    Dec 1969

    Default If Then statements

    I have three different options depending on what the user enters. I want the fourth to be if the user picks none of the first three options. The three options are SQL statements. Set recordsets equal to each outcome because of the table formatting I am using. I am saying...<BR><BR>&#060;% If option2 is nothing then<BR> do until option1.eof %&#062;<BR>... html for table formatting ...<BR>&#060;% option1.movenext<BR> loop<BR> ElseIf<BR> option1 is nothing then<BR> do until option2.eof %&#062;<BR>... html for table formatting ...<BR>... comment saying this next set of html is looped ...<BR>&#060;% do until option2.eof %&#062;<BR>... html for repeating formatting ...<BR>&#060;% option2.movenext<BR> loop<BR>Else<BR> response.write "Please choose a value."<BR>End If %&#062;<BR><BR>My code keeps looking for values for either option1 or option2. I did set them to nothing prior to this code just to make sure they are clear. Any ideas? I can e-mail my page to someone as it is not out on the web. It is for an intranet.<BR>

  2. #2
    Leungas Guest

    Default RE: If Then statements

    In this case, why not use the select case statement?<BR><BR>e.g.<BR><BR>select case &#060;expression x&#062;<BR>case option1 ...do something<BR>case option2 ...do something<BR>case option3 ...do something<BR>case else ...do something for everything else<BR>end select<BR><BR>this will probably make things easier.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts