Actually, I just dealt with this...
intScreens = (cnItems.RecordCount Mod 15) + Int(cnItems.RecordCount /
15)
MOD will return a zero if there is no remainder and a one if there is.
Int forces the number to be a whole number, therefore getting ride of
everything past the decimal.
I'm sure you can figure out how to apply this to what you need to do.
MOD does not return zero or one. The MOD operator returns the
remainder after division. It can be a very helpful operator in certain
cases.
A typical case where I have used it is to cycle through a number of
items, once per day. I take a date, do some date math to determine the
number of days since that date till now, then use MOD to figure out
which item to display...
s(0) = "First Item"
s(1) = "Second Item"
s(2) = "Third Item"
s(3) = "Fourth Item"
s(4) = "Fifth Item"
itm = s(datediff("d", "9/11/2001", now) mod 5)
After dividing the number of days since 9/11, the MOD operator returns
the remainder. Let's say there were only 2 days since 9/11. 2 MOD 5
returns 2, so the s(2) would be returned. On the third day 3 MOD 5
returns 3, so s(3) would be returned.
Later, when it's 303 days after 9/11, 303 MOD 5 returns 3 (303 divided
by 5 is 60 with a remainder of 3).