Results 1 to 3 of 3

Thread: two options

  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Unanswered: two options

    i have got two sql statements that perform two seperate queries for the user. I want the user to select which one to perform either option a or option b. how can this be done. i think use of case function can be used but how do you you implement that.

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    You can ask the user to select which one they want to do in a form with option buttons, and then retrieve the selected choice using the Request object on the action page of the form.

    Then just test which they selected using an If statement, and execute the appropriate query.

    Tim
    Last edited by MrWizard; 02-27-05 at 01:09.
    Tim

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Or if a textbox or listbox called WhichOne and the page gets posted:

    Select Case lcase(Request.Form("WhichOne"))
    Case "a"
    [The code to run if the case is a]

    Case "b"
    [The code to run if the case is b]
    End Select

    Or

    If lcase(Request.Form("WhichOne")) = "a" Then
    [The code to run if the case is a]
    Elseif lcase(Request.Form("WhichOne")) = "b" Then
    [The code to run if the case is b]
    End If
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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