Solved

If subreport has no data, do not show text

Posted on 2014-02-06
2
444 Views
Last Modified: 2014-02-06
I have a second page on an Access report that I do not want shown if there is no data in the subreport that makes up that second page. My subreport does not appear if it is empy so I'd like the text above it to also not appear.  I'd really not even like a second page, if possible.  
My subreport is tblContractAiringDatesSubreport.  
The text I"m trying to hide is Text165.

I cannot get the syntax to work:
Private Sub tblContractAiringDateSubreport_Enter()
If Me.Report.HasData Then
    Me.Text165.Visible = True
 Else
    Me.Text165.Visible = False
End If
End Sub

I'm not even sure if this is where I should be putting the If statement.
But also not sure the subreport is being reference correctly.
Thanks in advance for any help.
0
Comment
Question by:haident
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39839173
try this in the control source of the textbox


=IIf([tblContractAiringDatesSubreport].[Report].[HasData],Null,'NO data to display')
0
 

Author Closing Comment

by:haident
ID: 39839705
Thanks!  Worked if I rearranged the IIf to put Null if no false, and I get because I then display my merged text.  But what if I just want to diaplsy an image?  What do I put in the TRUE part?

=IIf([tblContractAiringDates subreport].[Report].[HasData],DLookUp("VendorAddressAddr1","tblVendor","VendorName= '" & [Station] & "'") & " Specific Airdates for " & [Start Date] & " - " & [Expiration] & " contract:",Null)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question