Greetings,
I am new to this site and am in hopes that someone can help me out with a problem I am having. I have a calendar that was built by someone else that I need to slightly modify. The guy who built this calendar is an asp genius but I can not find him, I have not had contact with him for over 5 years and I need to modify this page. I am not ASP illiterate but I am no genius either. The issue is trying to loop through the recordset, but I need to loop through twice. Is that possible and if so can anyone help me with the code? Here is what I want to do... The calendar is quite simple, it displays the days of the week and it a date has an event associated with it then it displays an image on that date. What I want to do is to have the image changed according to a yes/no value in a separate field in the database. The code that loops through now is...
<% PutImage = "False" %>
<% If Not QResults.EOF Then %>
<% Do While CurrentNumber = Day(QResults("StartDate")) %>
<% PutImage = "True" %>
<% QResults.MoveNext %>
<% If QResults.EOF Then %>
<% Exit Do %>
<% End If %>
<% Loop %>
<% End If %>
The above code works wonderfully...
Now I want to make PutImage be one image if it is an event and another image if the date is booked to capacity. I have a field in the database called Booked with a yes/no value. I have tried to do a simple if statement like this...
<% if (QResults("Booked")) = "True" Then %>
<img src="<%= BookedImage %>" border="0"></a>
<% else %><img src="<%= EventImage %>" border="0"></a>
<% end if %>
But as you can suppose I get the error error '80020009' Exception Occured at the last record that has a value.Upon further researching this error I have found that it is caused by not looping through the recordset. If anyone can be of assistance I would greatly appreciate it.
Thanks
JW