Solved

If subreport has no data, do not show text

Posted on 2014-02-06
2
443 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSMA Access BE Linked Table Migration Linking Issue 2 40
Google drive Permission Error 43 47
Access 2010 7 41
How do a DCount on a report 1 17
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views 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 Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 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