Control not found

  • Thread starter Thread starter BR
  • Start date Start date
B

BR

I am creating a Summary Report for a survey. There are
over 120 fields on the report. I am retrieivng the total,
testing for zero quantity and calculating the percentage
for each field using using VB in the Details OnPrint
Event. Ater 165 lines of code I am getting Control Not
Found for the same codes I just referenced previously. Is
there a limit to the lines of code in a reports Detail
OnPrint Event or do I just need to move the majority of
the code to a Module?
 
BR:

No, there is no limit to the number lines of code in a report module. If
you are referencing a control which is not contained in the current section
of the report that is not printing you can receive that error; alternately,
if you have a control name that may conflict with a reserved VB or Access
word, property name or method name you might receive that error as well
(e.g. Me!Name)
 
It's not just one control, it's all controls after the 165
line of code. Example:
Me.txtQOLT1Tot = (Me.txtQOLJackT1 + Me.txtQOLNeigT1 +
Me.txtQOLProgT1)
If Me.txtQOLT1Tot = 0 Then
Me.txtQOLP1Tot = 0
Else
Me.txtQOLP1Tot = (Me.txtQOLT1Tot / lTotalRecs)
End If

All referenced controls are not found even though they
were referenced 50 lines of code ago. Any help is
appreciated.
Thanks: BR
 
For anyone encountering this error. I restarted my
computer and without changing anything, the report is now
working. If all else fails...
 
Back
Top