Put the code in the format event of the report.
Re: Hiding Label and Text Control if the Value is Null II
--------------------------------------------------------------------------------
Quote:
Originally Posted by mmccarthy
To be honest, I've never tried running a subform in a report. The problem may be with the Form_Current event as I'm not sure how this would trigger on a report. You could try putting the following in the Reports OnFormat event.
Code: ( vb )
Private Sub Detail_Format()
If Reports![ReportName]![SubformName].Form![RDamortization1] > 0 Then
Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = True
Else
Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = False
End If
End Sub
Im using the subform in the report so that i can print to the clients the calculations to get a product final price. In the form a user enters some parameters (tax, labor work, time required, etc.) and the layout of the calculations are displayed. Is there any other way to do it???
Hello again, im using the following:
Code: ( text )
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDamortization1] > 0 Then
Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = True
Else
Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = False
End If
End Sub
but i get the error: 2465 saying that it CANT find the FIELD 'SUBPricingL1V1'
As it mentioned FIELD i deleted the FROM part from the equation (If Reports![Pricing L1V1]![RDamortization1] > 0 Then..... BUT im still getting the same error.
Any ideas...Thanks again,
Gilberto