Hi
I need some help.I will be very thankful to you if you can help me. This is my program stepwise. I had some guys helping me but I didnt get reply from them again thats why i am posting again. I appreciate them. Pls someone help me.
Note: Everytime I select an item from the combo box or select box I havea wrote function so it retuns the whole ReportTrainingType ASP page. with this function SubmitMe()
1) I have a combo box on a form which has three values. TP,SP,IP. When I select one of the value from the combobox TP, or IP or SP
2) it gives me a list of records which I populate in the Select box I have.
3) When I click on the select box item it gives me the records of the employee in that particular item. It gives me all the records.
4) I want only a certain number of records using the date fields.
5) So I kept a date field on the form and retrieve those values.
I used this function to refresh the ReportTrainingType ASP page
function SubmitMe()
{
document.TCForm.submit();
return(true);
}
' This is the initial combo box
<form method="POST" name="TCForm" action="RptTrainingbyTypeCode.asp?menuid=<%=menuid%>&typeid=<%=TType%>">
<SELECT name="TrainType" size="1" onchange="SubmitMe()">
<%
'Populate the drop down menu with training code names
response.write "<OPTION VALUE = -1> </OPTION>"
Do While NOT RST.EOF
if cint(RST("Training_Method_ID")) = TType then
Response.Write "<OPTION VALUE='" & RST("Training_Method_ID") & "' SELECTED>"
Response.Write RST("Training_Method_Text") & "</OPTION>"
else
Response.Write "<OPTION VALUE='" & RST("Training_Method_ID") & "'>"
Response.Write RST("Training_Method_Text") & "</OPTION>"
end if
RST.MoveNext
Loop
rst.close
set rst = nothing
%>
' This is the Select box where i select the item to display all the emp records.
response.write "<SELECT name='TrainCode' size='10' onclick='SubmitMe()'>"
'Go through list and write information
do while not rst.eof
WriteClass(TType)
rst.movenext
loop
response.write "</Select>"
end if
rst.close
set rst = nothing
' This where I display the all the emp records.
Set RST=Server.CreateObject("adodb.recordset")
rst.open strSQL, conn
if not rst.eof then
rst.MoveFirst
response.write "<tr><td><b><u>Employee Name</u></b></td><td align='center'><b><u>Date Trained</u></b></td><td><b><u>Employee Name</u></b></td><td align='center'><b><u>Date Trained</u></b></td></tr>"
CurrentName = -1
NameCount = 1
'Go through list and write information. Eliminate duplicates.
do while not rst.eof
if CurrentName <> rst("Employee ID") then 'Different Names. Print
if NameCount = 1 then
response.write "<tr>"
end if
Response.Write " <td width='200'>" & rst("First Name") & " " & rst("Middle Name") & " " & rst("Last Name") & "</td><td width='200' align='center'>" & rst("Training_Date") & "</td> "
if NameCount = 2 then
response.write "</tr>"
NameCount = 1
Else
NameCount = NameCount + 1
end if
CurrentName = rst("Employee ID")
' else Names are same. Do not print duplicates.
end if
rst.movenext 'Go to next record
loop
end if
rst.close
set rst = nothing
conn.close
set conn = nothing
end if
%>
Pls help me
Thanks
I need some help.I will be very thankful to you if you can help me. This is my program stepwise. I had some guys helping me but I didnt get reply from them again thats why i am posting again. I appreciate them. Pls someone help me.
Note: Everytime I select an item from the combo box or select box I havea wrote function so it retuns the whole ReportTrainingType ASP page. with this function SubmitMe()
1) I have a combo box on a form which has three values. TP,SP,IP. When I select one of the value from the combobox TP, or IP or SP
2) it gives me a list of records which I populate in the Select box I have.
3) When I click on the select box item it gives me the records of the employee in that particular item. It gives me all the records.
4) I want only a certain number of records using the date fields.
5) So I kept a date field on the form and retrieve those values.
I used this function to refresh the ReportTrainingType ASP page
function SubmitMe()
{
document.TCForm.submit();
return(true);
}
' This is the initial combo box
<form method="POST" name="TCForm" action="RptTrainingbyTypeCode.asp?menuid=<%=menuid%>&typeid=<%=TType%>">
<SELECT name="TrainType" size="1" onchange="SubmitMe()">
<%
'Populate the drop down menu with training code names
response.write "<OPTION VALUE = -1> </OPTION>"
Do While NOT RST.EOF
if cint(RST("Training_Method_ID")) = TType then
Response.Write "<OPTION VALUE='" & RST("Training_Method_ID") & "' SELECTED>"
Response.Write RST("Training_Method_Text") & "</OPTION>"
else
Response.Write "<OPTION VALUE='" & RST("Training_Method_ID") & "'>"
Response.Write RST("Training_Method_Text") & "</OPTION>"
end if
RST.MoveNext
Loop
rst.close
set rst = nothing
%>
' This is the Select box where i select the item to display all the emp records.
response.write "<SELECT name='TrainCode' size='10' onclick='SubmitMe()'>"
'Go through list and write information
do while not rst.eof
WriteClass(TType)
rst.movenext
loop
response.write "</Select>"
end if
rst.close
set rst = nothing
' This where I display the all the emp records.
Set RST=Server.CreateObject("adodb.recordset")
rst.open strSQL, conn
if not rst.eof then
rst.MoveFirst
response.write "<tr><td><b><u>Employee Name</u></b></td><td align='center'><b><u>Date Trained</u></b></td><td><b><u>Employee Name</u></b></td><td align='center'><b><u>Date Trained</u></b></td></tr>"
CurrentName = -1
NameCount = 1
'Go through list and write information. Eliminate duplicates.
do while not rst.eof
if CurrentName <> rst("Employee ID") then 'Different Names. Print
if NameCount = 1 then
response.write "<tr>"
end if
Response.Write " <td width='200'>" & rst("First Name") & " " & rst("Middle Name") & " " & rst("Last Name") & "</td><td width='200' align='center'>" & rst("Training_Date") & "</td> "
if NameCount = 2 then
response.write "</tr>"
NameCount = 1
Else
NameCount = NameCount + 1
end if
CurrentName = rst("Employee ID")
' else Names are same. Do not print duplicates.
end if
rst.movenext 'Go to next record
loop
end if
rst.close
set rst = nothing
conn.close
set conn = nothing
end if
%>
Pls help me
Thanks