Solved

If subreport has no data, do not show text

Posted on 2014-02-06
2
431 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
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now