Hide subreport when it has no values

fraser_lindsay

Access wannabe
Local time
Today, 15:23
Joined
Sep 7, 2005
Messages
218
Hi,

I'm not having mcuh luck but I have been trying to hide a subreport in a rport and idsplay a comment when it is hidden, but only when there are no values in it for that record.

I have tried a number fo methods. My most recent uses an unbound text box to display a value and then I try this code in the 'On load' event of the form:

If Me.txtHS_YESNO = Null Then

Me.lblComments.visible = False
Else
Me.lblComments.visible = True

End If



I can't get it to work though. They all display or I get an error message.


Is this a dodgy use of 'Null'?
 
Search here for the has data method, there are many examples posted
 
Thanks.

For anyone else interested in how to do this....

I setup a text box and changed the control source to

=IIf([Subformname].[Report].[HasData],Null,"Whatever text you wanted displayed here")

So if the subform/subreport in the master report contains data it returns null i.e. blank textbox, otherwise it returns the text in the quotations.
 
Another method is something like ...

Code:
If Not ReferenceName.Report.HasData Then
Me.lblComments.visible = False
Else
Me.lblComments.visible = True
End If

-dK
 

Users who are viewing this thread

Back
Top Bottom