ok, if u want to get the value in the next page, just simply use
var = request("ALTPOC_ID")
then the value of ALTPOC_ID will be stored in var.
u can use request or request.string, both will be worked
hope this help
Main Topics
Browse All TopicsExperts,
I have a drop down called 'FullName'. Each Record has a User_ID(pk assigned to each record). I want to insert this User_ID into another field called 'ALTPOC_ID'. The problem is grabbing the User_ID value..
Here's a snippet of my code...
<%
ALTPOC_ID = request.querystring("User_
Set oConn = Server.CreateObject("ADODB
Set oRs = Server.CreateObject("ADODB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/data/data
strSQL = "SELECT User_ID,FullName,Agency,Ph
WHILE NOT oRs.EOF
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
ELSE strFullName = strFullName & "<option value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
END IF
oRs.MoveNext
WEND
oRs.Close
oConn.Close
%>
<input type="hidden" name="ALTPOC_ID" value="<%= ALTPOC_ID %>">
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Maybe:
<%
ALTPOC_ID = request.querystring("User_
Set oConn = Server.CreateObject("ADODB
Set oRs = Server.CreateObject("ADODB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/data/data
strSQL = "SELECT User_ID,FullName,Agency,Ph
WHILE NOT oRs.EOF
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
ELSE
strFullName = strFullName & "<option value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
END IF
oRs.MoveNext
response.write "<input type=""hidden"" name=""ALTPOC_ID"" value=" & oRs("User_ID") & ">"
WEND
oRs.Close
oConn.Close
%>
Since each User_ID belongs to a different record..you want to repeat it within the loop:
<%
ALTPOC_ID = request.querystring("User_
Set oConn = Server.CreateObject("ADODB
Set oRs = Server.CreateObject("ADODB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/data/data
strSQL = "SELECT User_ID,FullName,Agency,Ph
WHILE NOT oRs.EOF
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
ELSE strFullName = strFullName & "<option value=" & oRs("User_ID") & ">" & oRs("FullName") & "</option>"
END IF
oRs.MoveNext
WEND
oRs.Close
oConn.Close
'beginning of your form goes here
response.write ("<select name='User_ID' size='1'>" & strFullName & "</select>")
' rest of your form goes here
%>
Now when a user submits from this page...selects the user_id...have another page which inserts the record. Oh and make sure your form is set to "get" not "post"
I think you want to get the user id of the username you selected if that is rigth do this
<%
ALTPOC_ID = request.querystring("User_
Set oConn = Server.CreateObject("ADODB
Set oRs = Server.CreateObject("ADODB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/data/data
strSQL = "SELECT User_ID,FullName,Agency,Ph
WHILE NOT oRs.EOF
<select name =User_ID>
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("User_ID") & ">" & oRs("FullName") & "</option>"
ELSE strFullName = strFullName & "<option value=" & oRs("User_ID") & ">" & oRs("FullName") & "</option>"
END IF
oRs.MoveNext
</select>
WEND
oRs.Close
oConn.Close
%>
Hello,
The FullName Combo Box is populating fine now. However, the corresponding text field named ALTPOC_ID is not changing value along with the combo box...I guess I need another if statement to make that part work..i hope i make sense. im confused is all..
so if i pick John Smith then the ALTPOC field should read 21 or whatever record that is...right now it's just saying unknown..
<%
Set oConn = Server.CreateObject("ADODB
Set oRs = Server.CreateObject("ADODB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/data/data
strSQL = "SELECT User_ID,FullName,Agency,Ph
'strSQL = strSQL & "WHERE User_ID = Users.User_ID"
oRs.Open strSQL, oConn, adOpenKeyset, adLockOptimistic
WHILE NOT oRs.EOF
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
ALTPOC_ID = "Unknown"
ELSE strFullName = strFullName & "<option value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
'ALTPOC_ID = oRs("User_ID")
ALTPOC_ID = "Unknown"
END IF
oRs.MoveNext
WEND
oRs.Close
oConn.Close
%>
'form here..
<select size="1" name="FullName">
<%=strFullName%>
<option value="Unknown" selected>Select Sponsor</option>
</select></font>
<input type="" name="ALTPOC_ID" value="<% =ALTPOC_ID %>"> THIS DOESNT WORK...=(
You could do that using JavaScript. But if all you really want is that when someone SUBMITS this form for ALTPOC_ID to appear in the URL or something, all you have to do is:
WHILE NOT oRs.EOF
IF oRs("FullName") = "Select Sponsor" THEN
strFullName = strFullName & "<option selected value=" & oRs("FullName") & ">" & oRs("FullName") & "</option>"
ELSE
strFullName = strFullName & "<option value=" & oRs("UserID") & ">" & oRs("FullName") & "</option>"
END IF
oRs.MoveNext
... that way when you submit the form doing Request.Form("FullName") will have the user id....
Hi,
I removed the request.querystring portion of the code because it wasn't what I was trying to do. I have a drop down box (FullName) which is populating fine. The corresponding text box named ALTPOC is not populating though. I think I'm missing another if statement to make that field work..
In a nutshell, I have the FullName combo box populating, I need it's corresponding text field box to populate based on the combo box selection.
COMBO BOX -populates, user picks John Smith TEXT FIELD ALTPOC - should display User_ID based on user's select from combo Box so if John Smith is picked then this box should read '21'
Right now, it's reading nothing =( ick...so im guessing im missing another select for this TEXT FIELD
Business Accounts
Answer for Membership
by: WoodyRoundUpPosted on 2005-07-11 at 17:13:55ID: 14417594
What's the URL that you are calling from?
How's your form like?
Can you post your form tag here?