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
%>