Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    10

    Question Unanswered: value 'HIGH' + 'TOP' = 'URGENT'

    A+b=c
    Here is a small script that i have to sumit some data from a FORM.
    What i want. I got in my access database 2 columns.
    One called "Impact". And one called "Reoccurrence".
    In my form you can select several data from pull down menu.

    Now i want to have a script that does put a VALUE in a other COLUMN called "PRIO". (when the other 2 columns have a specific VALUE)

    So when you pick in pull down menu of form the value 'HIGH' for "Impact". And ''HIGH' in "Reoccurrence" then there must be the VALUE 'URGENT' in column "PRIO" (so only when HIGH AND TOP ARE SELECTED. THEN 'URGENT' in PRIO Column)

    I was thinking to do this in the HANDLER.ASP that i did make to submit the data into my access DB.
    Here is the script for the handler.

    Can sombody give me the code to make what i want?

    -------------------------------------------------------------
    <%

    'Open Connection

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "problemman"
    SQL=""

    Dim NameValue(125,2)
    intformfields = 0
    For each item in Request.Form

    IF Item = "PMID" OR Request.form(Item) = "" OR Request.form(Item) = "Submit Changes" OR Request.form(Item) = "notneeded" THEN
    intformfields = intformfields + 1
    ELSE
    NameValue(intformfields,0) = "Checklist."&Item
    NameValue(intformfields,1) = Request.form(Item)
    intformfields = intformfields + 1

    END IF

    Next

    SQLStart = "Update Checklist Set "
    SQLEnd = " WHERE (((Checklist.PMID )= "& Request.form("PMID") &"));"

    'SQLEnd = " WHERE (((Checklist.Title )= '"& Request.form("Title") &"'));"
    SQL = ""

    For i = 0 to 124
    IF trim(NameValue(i,0)) <> "" THEN
    'response.write i&". "&NameValue(i,0)&" = "&NameValue(i,1)&"<BR>"
    SQL = SQL & NameValue(i,0) & "='" & NameValue(i,1) & "',"
    END IF
    Next

    SQL = Left(SQL, len(SQL) - 1)

    Conn.Execute(SQLStart & SQL & SQLEnd)

    SQL = "Checklist.prio" = High

    SQL = "Checklist.Last_Updated"& "='" & Now() & "'"

    IF Request.Form("status") = "Closed" THEN
    SQL = "Checklist.Problem_closed"& "='" & Now() & "'"

    Conn.Execute(SQLStart & SQL & SQLEnd)


    'Set RS= Nothing
    'RS.Close
    END IF

    %>
    just joost :-)

  2. #2
    Join Date
    Nov 2002
    Posts
    11
    Basically, you are looking for nested SELECT statements...

    Something like this:

    Code:
    <%
    Dim impact
    Dim reoccurrance
    Dim priority
    
    impact = UCase(Request.Form("impact"))
    reoccurrance = UCase(Request.Form("reoccurrance"))
    
    ...
    
    Select Case impact
    
      Case "HIGH"
        Select Case reoccurrance
          Case "HIGH"
            priority = "URGENT"
          Case "MEDIUM"
            priority = "NOT QUITE SO URGENT"
          Case "LOW"
            priority = "FLUKE ACCIDENT"
        End Select 'reoccurrance
      Case "MEDIUM"
        Select Case reoccurrance
          Case "HIGH"
            ...
    End Select 'impact
    
    SQL = "UPDATE CheckList Set Prio = '" & priority & "' WHERE ..."
    Hope this helps...
    - Brandon

Posting Permissions

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