JohannIcon
Programmer
I have an asp that displays a table, with the current Year and a list of the months, and when the user clicks on the month he wants, he is taken to a link displaying another asp.
I also have an Access table, with this relevant information. Now what I want to do is display a list of DISTINCT years there is in the database, which I am already doing, and then when the user clicks on a particular year, the HTML table is populated with the YEAR the user chooses and the relevant links to that year which I bring from the database.
How can I create these (YEAR) buttons dynamically? I was thinking of doing something like this:-
<%
rsYearStats.movefirst
do
%>
<form name="Year" method="post" action="stats.asp">
<center>
<%
Response.Write " <input name=Year type=submit id=Year class=menu value=" rsYearStats.Fields("Year"
">"
Response.Write(" "
rsYearStats.MoveNext
if rsYearStats.eof then
exit do
End If
loop until rsYearStats.eof
%>
</center>
</form>
where stats.asp is the current asp page. However I have some errors in the syntax. Can you please help me out here?
I also have an Access table, with this relevant information. Now what I want to do is display a list of DISTINCT years there is in the database, which I am already doing, and then when the user clicks on a particular year, the HTML table is populated with the YEAR the user chooses and the relevant links to that year which I bring from the database.
How can I create these (YEAR) buttons dynamically? I was thinking of doing something like this:-
<%
rsYearStats.movefirst
do
%>
<form name="Year" method="post" action="stats.asp">
<center>
<%
Response.Write " <input name=Year type=submit id=Year class=menu value=" rsYearStats.Fields("Year"
Response.Write(" "
rsYearStats.MoveNext
if rsYearStats.eof then
exit do
End If
loop until rsYearStats.eof
%>
</center>
</form>
where stats.asp is the current asp page. However I have some errors in the syntax. Can you please help me out here?