I wrote this function for my class. It's sole purpose is to get the total number of pages by dividing the number of records by the items listed per page. easy enough right? <BR><BR>WRONG!!! <BR><BR>here is the function<BR><BR>[code language="vbscript"]<BR> Private Sub GetTotalPages()<BR> Response.Write Me.Tcount & "-" & Me.ItemsPerPage ' Debug use<BR> If Me.TCount > Me.ItemsPerPage Then<BR> c_TotalPages = Fix(Me.TCount / Me.ItemsPerPage)<BR> If Me.TCount Mod Me.ItemsPerPage > 0 Then c_TotalPages = c_TotalPages + 1<BR> Else<BR> c_TotalPages = 1<BR> End If<BR> End Sub<BR>[/code]<BR><BR>now were the debug code is "Response.Write Me.Tcount & "-" & Me.ItemsPerPage.<BR>the result is 91-5 which means there is 91 records and showing 5 per page.<BR><BR>The if statement!! Why isn't it working it is going to the "Else" All I said was if the total number of records is greater than the number of items listed per page then do something!<BR><BR>Should work, but it doesn't!<BR><BR>Now it only does this if the items per page is changed (via querystring) from it's default of 20. Even if (in the querystring) it is set at 20 it will do this, here is the property for the items per page.<BR><BR>[code language="vbscript"]<BR>Public Property Get ItemsPerPage()<BR> If c_ItemsPerPage = "" Then c_ItemsPerPage = 20<BR> ItemsPerPage = c_ItemsPerPage<BR>End Property<BR>[/code]<BR><BR>And on initialize i set c_ItemsPerPage to Request.Querysting("i")<BR><BR>I am going nuts, it is defying math, I think. I don't know someone please help me.