I've finally got the code to work.......kinda
I inserted the code Me![PageBreak122].Visible = [ROSTER_NBR] Mod 99 = 0
(I changed the name of the counter to ROSTER_NBR) and now the report does
start a new page at the 100th record but it doesn't reset the counter to
1.
It continues to count 100-198, page break then 199-297 and so on.
My counter is an unbound textbox and in the control source I inserted the
following code =IIf([CurrentRecord]=1,1,1), which I found here a week or
so
ago. I've tried If.....Then statements to reset the counter, but I keep
getting an error informing me that the field cannot be updated. I also
played around with the currentrecord property, but that wasn't getting me
anywhere either.
I also tried the other code I was provided, but it stops at the line:
Me.GROUP = Asc(lngCalcVal Mod 26 + 66)
It informs me that "the object cannot be updated", (referring to GROUP?).
I
can't really troubleshoot the code because I don't understand the ASC
function or how the MOD property fits.
Any help you can give me would be greatly appreciated.
jimphilly said:
John
Thanks for your answer but, unfortunately, I'm not understanding
I get an error when I run Me.PageBreakControl.Visible = Me.BATCH_NBR Mod
99
= 0. It gives me a compile error (Me.BATCH_NBR) " Method or data member
not
found ". Additionally, I don't understand how the MOD operator works in
this
application.
When I run the untested code snippet, I get an error informing me I can't
assign a value to this object. It's referring to the text box I'm using
to
capture the roster name. I'm calling it GROUP.
This is the line of code where it stops: Me.GROUP = Asc(lngCalcVal Mod 26
+
66) .
Intelisense tells me that the variable lngCalcVal = 0 after running this
line of code: lngCalcVal = Me.BATCH_NBR \ 99.
Could you explain the ASC Function? Help says a runtime error occurs if
the string has no characters. Is this the reason this error is
occurring?