Sorry, subject line wasn't descriptive. But, hey, I'm stuck. I'm inserting the results of a few fields from a form like this.
<%option explicit
dim objCn, objRs, sSql
%>
<!-- #include file = "../includes/db.asp" -->
<%
dim person_name, requests, time_to_contact
dim original_notes, leader, cor_blimey
dim user
dim the_day_today
person_name = request.form("person"
requests = request.form("selectRequest"
time_to_contact = request.form("txttime"
original_notes = request.form("txtnotes"
leader = request.form("leader"
cor_blimey = request.form("txtCorradd"
user = session("USERID"
the_day_today = FormatDateTime(Date, 2)
if session("USERID" <> "" then
sSql = "INSERT INTO SFINANCE (PERSON_QR, DATE_OF_REF, REQUEST, CONTACT_TIME, ORIG_NOTES, LEAD_GENERATED, ACC_MAN, CORR_ADDRESS) VALUES ( '" &_person_name & "', '" & the_day_today & "', '" & requests & "', '" & time_to_contact & "', '" & original_notes & "', '" & leader & "', '" & user & "','" & cor_blimey & "')"
set objRs = objCn.execute (sSql)
call closeConnection(objCn)
end if
response.redirect "view.asp"
%>
(that's the whole of the page - and it works fine like that)
Anyway, my question is. I don't want to insert the ACTUAL value of the 'person' text field. Instead I want to use that value in a query that I want to run on this page in order to get the real value (a sku/qr from another table) that I want to insert. How do I do that, structure-wise? Where do I put the query? I'm pretty baffled and would love some help. Promise to send happy thoughts to anyone gracious enough to lend a hand. Thankyou kindlymuch.
Sarah
<%option explicit
dim objCn, objRs, sSql
%>
<!-- #include file = "../includes/db.asp" -->
<%
dim person_name, requests, time_to_contact
dim original_notes, leader, cor_blimey
dim user
dim the_day_today
person_name = request.form("person"
requests = request.form("selectRequest"
time_to_contact = request.form("txttime"
original_notes = request.form("txtnotes"
leader = request.form("leader"
cor_blimey = request.form("txtCorradd"
user = session("USERID"
the_day_today = FormatDateTime(Date, 2)
if session("USERID" <> "" then
sSql = "INSERT INTO SFINANCE (PERSON_QR, DATE_OF_REF, REQUEST, CONTACT_TIME, ORIG_NOTES, LEAD_GENERATED, ACC_MAN, CORR_ADDRESS) VALUES ( '" &_person_name & "', '" & the_day_today & "', '" & requests & "', '" & time_to_contact & "', '" & original_notes & "', '" & leader & "', '" & user & "','" & cor_blimey & "')"
set objRs = objCn.execute (sSql)
call closeConnection(objCn)
end if
response.redirect "view.asp"
%>
(that's the whole of the page - and it works fine like that)
Anyway, my question is. I don't want to insert the ACTUAL value of the 'person' text field. Instead I want to use that value in a query that I want to run on this page in order to get the real value (a sku/qr from another table) that I want to insert. How do I do that, structure-wise? Where do I put the query? I'm pretty baffled and would love some help. Promise to send happy thoughts to anyone gracious enough to lend a hand. Thankyou kindlymuch.
Sarah