I have a report that generates one page per record retrieved in a query. Most of the time, the records are 90% the same with minor details being different. This is fine and doesn't affect my report. However, sometimes, a record will have very different information that gets ignored by the report.
For example, if I have a record that's very different than the others, there are certain controls that I want hidden only on the page with the different record. I tried placing the code both in Report_Load and Report_Current, but the controls are always visible.
The report code didn't fire at all in Report_Current, and only ran once in Report_Load. So, how do I get my code checked for each new page?
Below is the code in this example:
Code:
//Code located on the Form that generates the report. Each new page is created here.
Do While Not rst.EOF
If rst!OrdId = Me.OrdId And rst!ProdId = ## Then
strDocument = "myReport"
DoCmd.OpenReport strDocument, acViewPreview, , "([ordid]=" & rst!OrdId & ") And ( Not [CORE]= """ & "LBR" & """)"
End If
rst.MoveNext
Loop
-----
Code:
//This code is in the report. Hides the controls.
If Me.Face Like "unique identifier" Then
Label98.Visible = False
Text119.Visible = False
End If