Rather complex Visiblity operation

  • Thread starter oliaccount via AccessMonster.com
  • Start date
O

oliaccount via AccessMonster.com

Hi
In our system, there is a report that pulls together a parent and a sub
report, however, the details on the sub report are only needed for a
particular catagory (sorted by main report header). How do I go about setting
code that selects visiblity like this?
Thanks!!
 
K

krissco

Hi
In our system, there is a report that pulls together a parent and a sub
report, however, the details on the sub report are only needed for a
particular catagory (sorted by main report header). How do I go about setting
code that selects visiblity like this?
Thanks!!

In the section that holds the subreport (on your main report) use
this code behind the OnFormat event:

if me.headerConditionControl = "Some Condition" then
me.subReportControl.Visible = False
else
me.subReportControl.Visible = True
end if

-Kris
 
K

krissco

Hi
In our system, there is a report that pulls together a parent and a sub
report, however, the details on the sub report are only needed for a
particular catagory (sorted by main report header). How do I go about setting
code that selects visiblity like this?
Thanks!!

In the section that holds the subreport (on your main report) use
this code behind the OnFormat event:

if me.headerConditionControl = "Some Condition" then
me.subReportControl.Visible = False
else
me.subReportControl.Visible = True
end if

-Kris
 
O

oliaccount via AccessMonster.com

Thanks for the reply Kris

headerConditionControl
Visual Basic doesn't want to recongise this control though. I get this error
on it:
Compile Error
Method or data member not found
I'm running access 2000, by the way.
Cheers!!
 
K

krissco

Thanks for the reply Kris

headerConditionControl
Visual Basic doesn't want to recongise this control though. I get this error
on it:
Compile Error
Method or data member not found
I'm running access 2000, by the way.
Cheers!!

Maybe I should have written:
if <Type Your Boolean Condition In Here. Delete the angle brackets>
then
me.<Type the name of the thing you want to hide/show in here. No
Angle Brackets>.Visible = False
else
me.<Type the name of the thing you want to hide/show in here. No
Angle Brackets>.Visible = True
end if

-Kris
 
O

oliaccount via AccessMonster.com

Ahh, it works (thumbs up)!
Thanks for your help Kris

While I was checking the report preview, I uncovered another far bigger
problem that I was also able to fix. Good day all round.
 
O

oliaccount via AccessMonster.com

Ahh, it works (thumbs up)!
Thanks for your help Kris

While I was checking the report preview, I uncovered another far bigger
problem that I was also able to fix. Good day all round.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top