Try this:
-
Private Sub Report_Open(Cancel As Integer) 'place code in subreport
-
If nz([customerNo],0) = 0 Then
-
'can display a message here, if desired
-
Cancel = True
-
End If
-
End Sub
Regarding the page breaks, they could be caused several ways:
1. can be set via the report property sheet (go to the report property sheet and check.
2. can be set by placing a page break object from the tool box (place report in design view, check for page break object on left side of report, select with cursor, and delete)
3. can be set via vba code; review your code and check for code forcing a page break.
4. can be caused by a page overflow; check your report in design view; check to make sure that report objects (e.g. textboxes) don't fall outside the boundaries of the report and also make sure that report boundary plus margins don't exceed physical paper size.