I have a report where the main data is on the first page, however, one field I want to print on the second page if it is not null.I have set up the report with all the fields on the first page except for the particular field - "Additional Info". If "Additional Info" is empty, I don't want to print the second page. I have tried using a page break to force the second page and then coded the following, but this still prints a blank page which I don't want. Do I have a page break and make it visible false or can I conditionally remove the field if null so I only get the first page if the "Additional Info" is null. If it has data, then I want both pages printed.
Here is my code so far -
If ((IsNull(AdditionalInfo))) Then
'Remove following fields from second page if null
LabelDocketNo.Visible = False
txtDktNo.Visible = False
Line1.Visible = False
LabelFunction.Visible = False
txtFunction.Visible = False
LabelDate.Visible = False
txtDate.Visible = False
LabelTime.Visible = False
txtTime.Visible = False
LabelRoom.Visible = False
txtRoom.Visible = False
txtRoomID.Visible = False
LabelOrganisation.Visible = False
txtOrganisation.Visible = False
AdditionalInfo.Visible = False
Me.Label548.Visible = False
pgbreak.Visible = False
Else
LabelDocketNo.Visible = False
txtDktNo.Visible = False
Line1.Visible = False
LabelFunction.Visible = True
txtFunction.Visible = True
LabelDate.Visible = True
txtDate.Visible = True
LabelTime.Visible = True
txtTime.Visible = True
LabelRoom.Visible = True
txtRoom.Visible = True
txtRoomID.Visible = True
LabelOrganisation.Visible = True
txtOrganisation.Visible = True
AdditionalInfo.Visible = True
Me.Label548.Visible = True
pgbreak.Visible = True
End If
Here is my code so far -
If ((IsNull(AdditionalInfo))) Then
'Remove following fields from second page if null
LabelDocketNo.Visible = False
txtDktNo.Visible = False
Line1.Visible = False
LabelFunction.Visible = False
txtFunction.Visible = False
LabelDate.Visible = False
txtDate.Visible = False
LabelTime.Visible = False
txtTime.Visible = False
LabelRoom.Visible = False
txtRoom.Visible = False
txtRoomID.Visible = False
LabelOrganisation.Visible = False
txtOrganisation.Visible = False
AdditionalInfo.Visible = False
Me.Label548.Visible = False
pgbreak.Visible = False
Else
LabelDocketNo.Visible = False
txtDktNo.Visible = False
Line1.Visible = False
LabelFunction.Visible = True
txtFunction.Visible = True
LabelDate.Visible = True
txtDate.Visible = True
LabelTime.Visible = True
txtTime.Visible = True
LabelRoom.Visible = True
txtRoom.Visible = True
txtRoomID.Visible = True
LabelOrganisation.Visible = True
txtOrganisation.Visible = True
AdditionalInfo.Visible = True
Me.Label548.Visible = True
pgbreak.Visible = True
End If