A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

make subreport2 visible based on condition



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2009, 06:44 PM posted to microsoft.public.access.reports
Opal[_3_]
external usenet poster
 
Posts: 133
Default make subreport2 visible based on condition

Help, I am running Access 2003 and have
trouble getting this work right.

I have an unbound subreport that contains 3
additional subreports. I want only one of the 3
to be visible based on the value in a combo
box on a selection form. I can't seem to get
the reference right and have tried several
variations.

If Forms!frmWeeklyGLrpt!cboCC = 1 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = True
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = False
End If
If Forms!frmWeeklyGLrpt!cboCC = 2 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = True
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = False
End If
If Forms!frmWeeklyGLrpt!cboCC = 3 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = True
End If

I keep getting Runtime error 2455
"You entered an expression that has an invalid reference to the
property
Form/Report."

Can anyone help me out?
  #2  
Old December 14th, 2009, 09:05 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default make subreport2 visible based on condition

Opal wrote:

Help, I am running Access 2003 and have
trouble getting this work right.

I have an unbound subreport that contains 3
additional subreports. I want only one of the 3
to be visible based on the value in a combo
box on a selection form. I can't seem to get
the reference right and have tried several
variations.

If Forms!frmWeeklyGLrpt!cboCC = 1 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = True
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = False
End If
If Forms!frmWeeklyGLrpt!cboCC = 2 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = True
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = False
End If
If Forms!frmWeeklyGLrpt!cboCC = 3 Then
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDA.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDB.Visib le = False
Me!subrptGLWeekly.Report!subrptGLWeeklyCMRDC.Visib le = True
End If

I keep getting Runtime error 2455
"You entered an expression that has an invalid reference to the
property Form/Report."


I think that happens if your code is in the main report's
Open event. Try moving it to the report header's Print
event or maybe you need it in the main report section that
contains the subrptGLWeekly subreport.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.