If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > value 'HIGH' + 'TOP' = 'URGENT'

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-02, 10:14
jvdzwaan jvdzwaan is offline
Registered User
 
Join Date: Nov 2002
Posts: 10
Question 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 :-)
Reply With Quote
  #2 (permalink)  
Old 12-02-02, 15:57
brandonh6k brandonh6k is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On