I am relatively new to asp, and need some help.
I have a form that a drop down box is dynamically populated with TeamNames, and this works.
I then pass this information, via a submit button (action=get) to another page that I want to show the Team Name, then list each member of that team, with an input box associated with that team member to enter miles run. Each team has an 'ID' associated with it. I can get the Team Name to show up, but the members names do not. I know it's how I'm passing the information, but just can't figure out what I'm doing wrong.
Drop down page code:
<%
session("TeamName") = TeamName
session("Member1") = Member1
session("Member2") = Member2
session("Member3") = Member3
session("Member4") = Member4
Cmd = "SELECT ID, Member1, Member2, Member3, Member4 FROM MillionTeams WHERE TeamName = '" & TeamName & "'"
If Request.Querystring("GET") = "yes" Then
rs.open cmd, conn
ID = rs("ID")
TeamName = rs("TeamName")
rs.close
Cmd = "SELECT * FROM MillionTeams WHERE ID = "' & ID & "'"
Rs.Open Cmd, Conn
ID = Request.Form("ID")
TeamName = Replace(Request.Form("TeamName"),"'","''")
Member1 = Request.Form("Member1")
Member2 = Request.Form("Member2")
Member3 = Request.Form("Member3")
Member4 = Request.Form("Member4")
Rs.Close
Then the display page coding is:
<%
TeamName = Request.querystring("TeamName")
cmd = "SELECT * FROM MillionSteps WHERE TeamName = '" & TeamName & "'"
If request.querystring("Get") = "yes" Then
ID = Request.Form("ID")
cmd = "SELECT * FROM MillionSteps WHERE TeamName = '" & TeamName & "'"
rs.open cmd, conn, adOpenStatic, adLockOptimistic
Dim ID, Member1, Member2, Member3, Member4
ID = Request.Form("ID")
TeamName = Request.Form("TeamName")
Member1 = Request.Form("Member1")
Member2 = Request.Form("Member2")
Member3 = Request.Form("Member3")
Member4 = Request.Form("Member4")
Member1Miles = Request.Form("Member1Miles")
Member2Miles = Request.Form("Member2Miles")
Member3Miles = Request.Form("Member3Miles")
Member4Miles = Request.Form("Member4Miles")
rs("TeamName") = TeamName
rs("Member1") = Member1
rs("Member2") = Member2
rs("Member3") = Member3
rs("Member4") = Member4
rs("Member1Miles") = Member1Miles
rs("Member2Miles") = Member2Miles
rs("Member3Miles") = Member3Miles
rs("Member4Miles") = Member4Miles
rs.update
rs.close
Else
ID = Request.querystring("ID")
cmd = "SELECT * FROM MillionSteps WHERE TeamName = '" & TeamName & "'"
%>
I know my coding isn't pulling the information correctly, and some is for the entering of the miles in the database, but I need to be able to associate the information pulled up on the display page with the correct team/team members so I can enter the milage for each correct team. I've messed with this so long, and tried so many different things, that some of the code probably isn't even necessary anymore.
Help!!