Printing Problem with reports

G

Guest

I have a report with a macro that hides certain images depending on the page
number. In print preview the images are where they're supposed to be, but
they do not print. This isn't a printer problem. As far as I can tell it's
a macro problem.

Here's an example of my macro:

SetValue
Item: [Reports]![letter template]![BoardList].[Visible]
Expression: IIf([Page]>=1,No,Yes)

This will show an image on the first page, but when printed, the image won't
be there. Does anyone have any advice?

Many thanks!
 
G

Guest

Hi -

I'm not sure I understand when or how the macro is invoked. If I were trying
to do this, I'd go to the section of the report where the image appears, and
use VBA. For example, set the .visible property for the graphic in the
PageHeader_Format procedure if the picture is in the header area.

- Phil Freihofner
 
G

Guest

Hmm. Maybe the problem is the IIF function. By saying ">=1", you'd only get
false on page 0 or less. If you want to print on page one, perhaps it should
be ">1" or ">=2".
- Phil
 
G

Guest

The macro is invoked by the On Page event under the report properties.

How would I use VBA to alter the .visible property?

Thanks!

Phil F said:
Hi -

I'm not sure I understand when or how the macro is invoked. If I were trying
to do this, I'd go to the section of the report where the image appears, and
use VBA. For example, set the .visible property for the graphic in the
PageHeader_Format procedure if the picture is in the header area.

- Phil Freihofner

Chad said:
I have a report with a macro that hides certain images depending on the page
number. In print preview the images are where they're supposed to be, but
they do not print. This isn't a printer problem. As far as I can tell it's
a macro problem.

Here's an example of my macro:

SetValue
Item: [Reports]![letter template]![BoardList].[Visible]
Expression: IIf([Page]>=1,No,Yes)

This will show an image on the first page, but when printed, the image won't
be there. Does anyone have any advice?

Many thanks!
 
G

Guest

For an object, call it "objGraphic" on a form or report:

Me("objGraphic").Visible = False
or
Me("objGraphic").Visible = True

The syntax with just dots should also work.
Me.objGraphic.Visible = True

For example, on your report, if the graphic is in the header:

1) click in the header area, open the properties box, and select the "On
Format" event to build code for that event.

2) from within the event, include the following:

IF Page() >1 THEN
Me.objGraphic.Visible = False
ELSE
Me.objGraphic.Visible = True
END IF


Phil Freihofner

Chad Landry said:
The macro is invoked by the On Page event under the report properties.

How would I use VBA to alter the .visible property?

Thanks!

Phil F said:
Hi -

I'm not sure I understand when or how the macro is invoked. If I were trying
to do this, I'd go to the section of the report where the image appears, and
use VBA. For example, set the .visible property for the graphic in the
PageHeader_Format procedure if the picture is in the header area.

- Phil Freihofner

Chad said:
I have a report with a macro that hides certain images depending on the page
number. In print preview the images are where they're supposed to be, but
they do not print. This isn't a printer problem. As far as I can tell it's
a macro problem.

Here's an example of my macro:

SetValue
Item: [Reports]![letter template]![BoardList].[Visible]
Expression: IIf([Page]>=1,No,Yes)

This will show an image on the first page, but when printed, the image won't
be there. Does anyone have any advice?

Many thanks!
 

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