UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Making A Subreport Visible, Access 2013    
 
   
hedge
post Nov 14 2017, 06:14 PM
Post#1



Posts: 449
Joined: 17-November 08



Hi,

I have a sub-report in a report that I would like to make visible when a field in the report is equal to "CSH". The field is also what I have the report grouping on, so it could have different values in the report.

I have put in this code, but doesn't seem to be working. any suggestion would be helpful.





CODE
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)

If Me.Contracted_Entity = "CSH" Then

Me.Report.HSV.Visible = True

End If


End Sub

Thanks,
Go to the top of the page
 
projecttoday
post Nov 14 2017, 11:35 PM
Post#2


UtterAccess VIP
Posts: 8,684
Joined: 10-February 04
From: South Charleston, WV


What's it doing instead?

CODE
If Me.Contracted_Entity = "CSH" Then

Me.Report.HSV.Visible = True

End If


Once visible, it will not become not visible.

Try this:

CODE
If Me.Contracted_Entity = "CSH" Then

Me.Report.HSV.Visible = True
Else
Me.Report.HSV.Visible = False

End If

--------------------
Robert Crouser

My company's website
Go to the top of the page
 
MadPiet
post Nov 15 2017, 12:18 AM
Post#3



Posts: 2,264
Joined: 27-February 09



And if you're sickeningly lazy, you can write it like this:
CODE
Me.Report.HSV.Visible = ( Me.Contracted_Entity = "CSH")
Go to the top of the page
 
hedge
post Nov 15 2017, 08:19 AM
Post#4



Posts: 449
Joined: 17-November 08



Hi,

Nothing actually happens when I run my code, or the 2 codes you suggested. I have the sub-report set to Visible = no in the properties and it stays non-visible when I run these codes.

Thanks,
Go to the top of the page
 
hedge
post Nov 15 2017, 08:37 AM
Post#5



Posts: 449
Joined: 17-November 08



Hi,

Actually it does work, it works when I go to print preview mode, but doesn't work when I am in Report View.

is there an event I can put it on that it would work on both?


Thanks for the help
Go to the top of the page
 
projecttoday
post Nov 15 2017, 08:42 AM
Post#6


UtterAccess VIP
Posts: 8,684
Joined: 10-February 04
From: South Charleston, WV


Not as far as I know. I always use Print Preview to avoid unpredictable behavior of Report View.

--------------------
Robert Crouser

My company's website
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 01:20 AM