Show or Hide Items on Report

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

Hi All,

I have a report that has a check box object.

If the check box is true I want it to show an object and hide another object.

On the Report event under page is where I was going to put the IF statment.

IF Control = True Then

Object.Visable = True
Object2.Visable = False

This doesn't appear to be the correct Syntax.

Please help.
Thanks
Matt
 
F

fredg

Hi All,

I have a report that has a check box object.

If the check box is true I want it to show an object and hide another object.

On the Report event under page is where I was going to put the IF statment.

IF Control = True Then

Object.Visable = True
Object2.Visable = False

This doesn't appear to be the correct Syntax.

Please help.
Thanks
Matt

Are these controls in the Report Detail section?
Code the Detail Format event:
Object.Visable = [CheckBoxName]
Object2.Visable =Not [CheckBoxName]
 
J

John Spencer

You need to run the code in the section (detail?) that contains the objects.

If SomeControl = True then
SomeObject.Visible = True
SomeOtherObject.Visible = False
else
'Switch the other way base on the control
SomeObject.Visible = False
SomeOtherObject.Visible = True
End If

You could use just the following, since your control is a boolean and will
always be true or false.

SomeObject.Visible = SomeControl
SomeOtherObject.Visible = Not(SomeControl)
 
M

mattc66 via AccessMonster.com

When I run the report I get a message that says object doesnt support this
property.


John said:
You need to run the code in the section (detail?) that contains the objects.

If SomeControl = True then
SomeObject.Visible = True
SomeOtherObject.Visible = False
else
'Switch the other way base on the control
SomeObject.Visible = False
SomeOtherObject.Visible = True
End If

You could use just the following, since your control is a boolean and will
always be true or false.

SomeObject.Visible = SomeControl
SomeOtherObject.Visible = Not(SomeControl)
[quoted text clipped - 16 lines]
Thanks
Matt
 
J

John Spencer

So what is the "Object" you are trying to show/hide? Is it a control on the
report?

Have you tried adding an error handler to your code? Would you consider
posting your code?

mattc66 via AccessMonster.com said:
When I run the report I get a message that says object doesnt support this
property.


John said:
You need to run the code in the section (detail?) that contains the
objects.

If SomeControl = True then
SomeObject.Visible = True
SomeOtherObject.Visible = False
else
'Switch the other way base on the control
SomeObject.Visible = False
SomeOtherObject.Visible = True
End If

You could use just the following, since your control is a boolean and will
always be true or false.

SomeObject.Visible = SomeControl
SomeOtherObject.Visible = Not(SomeControl)
[quoted text clipped - 16 lines]
Thanks
Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
 

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