I&#039;ve been working on this for 3 days, but can&#039;t debug this incredibly irritating problem with an ASP calendar system I have downloaded from Kamath.com (http://www.kamath.com/calendar/default.asp)<BR><BR>If anyone can help out with this I&#039;d be really grateful, I&#039;m getting really fed up with this thing. <BR><BR>It&#039;s centred around a function which gets the number of days in a month:<BR><BR> &#039;------------------------------------------------------------<BR> &#039; This function finds the last date of the given month<BR> &#039;------------------------------------------------------------<BR> Function GetLastDay(intMonthNum, intYearNum)<BR> Dim dNextStart<BR> If CInt(intMonthNum) = 12 Then<BR> dNextStart = CDate( "1/1/" & intYearNum)<BR> Else<BR> dNextStart = CDate(intMonthNum + 1 & "/1/" & intYearNum)<BR> End If<BR> GetLastDay = Day(dNextStart - 1)<BR> End Function<BR><BR>I know there are other more effective ways of doing it, as shown on aspfaqs.com but their method seems to generate other errors in the code. <BR><BR>Anyway, when you open the thing up it works fine, prints the calendar no probs. <BR><BR>Once you have added an event however the GetLastDay falls down and instead of returning the number of days for the month it returns the month number (i.e 5 for may instead of 31). <BR><BR>This then screws up the display of the calendar. The very strange thing is that if you close the browser and go back in, the problem sorts itself out. In fact, it seems like if you have other browser windows open it won&#039;t reset itself until you&#039;ve closed them all down, and then opened it up again! It seems like a pretty quirky error, but I can&#039;t work out how to get around it. <BR><BR>I have uploaded the code to www.jimpixsearch.co.uk/jimpix/kamath/cal.asp if you want to see the error in action. It&#039;s using uk dd/mm/yyyy format for adding events, I&#039;ve not done any error checking on that. <BR><BR>Also, if you need to see the code it is here: www.jimpixsearch.co.uk/jimpix/kamath/kamath.zip. <BR><BR>Thank you!