I've got a repport with several subrepports. The important thing is that I need it to show or hide two of them depending if they have a value or not. I made this code for it, it works perfectly on a form but on the report it doesn't do anything ?.?
I may be using wrong terms but I don't get any error either:
Private Sub Report_Open(Cancel As Integer)
If IsNull(Report.SubProf_cust) Then
Report.SubProf_cust.Visible = False
Report.SubProf_ssel.Visible = True ' No customer record
Else
Report.SubProf_cust.Visible = True
Report.SubProf_ssel.Visible = False ' Customer exists
End If
End Sub
The subreports are obviously: SubProf_cust & SubProf_ssel
The value that must be present is 'CustomerId' from SubProf_cust, otherwise the other subform can show instead.
It's for the ship address part of the repport.
I may be using wrong terms but I don't get any error either:
Private Sub Report_Open(Cancel As Integer)
If IsNull(Report.SubProf_cust) Then
Report.SubProf_cust.Visible = False
Report.SubProf_ssel.Visible = True ' No customer record
Else
Report.SubProf_cust.Visible = True
Report.SubProf_ssel.Visible = False ' Customer exists
End If
End Sub
The subreports are obviously: SubProf_cust & SubProf_ssel
The value that must be present is 'CustomerId' from SubProf_cust, otherwise the other subform can show instead.
It's for the ship address part of the repport.