Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Preview Picture but not Print 1

Status
Not open for further replies.

carfj1

Technical User
Jan 19, 2003
58
MX
I am printing on an Invoice Master. It has a labeled secuential number. On them a report must be printed.

The Print Preview has to show a Scanned JPG picture of the Master, but when the Print ICON is pressed the picture has to disappear and only print the DATA.

I have tried:
1.- Page Setup -> Print Only Data, but on this way Print Preview cannot see the Picture.

2.- On the Report Event - > On Page, using the code:

Private_Sub Report_Page()
Me.Picture = ""
End sub

Prints the image on the first print, the good thing is
that it removes the picture, so in the next pritn comes
be without the picture.

Can someone tell me how to reduce the cost of printing always a sample invoice?

Thanks,
Carlos
 
Try this. In the Report Footer Section and in the On Print event procedure enter the following:

Me.Pricture.Visible = False

This idea here is that the control Picture will display for the Print Preview but added code will have executed after the Print Preview display and when the Print icon is clicked the visible property of the Picture control is set to false. Works here for me in a test report. Check it out in yours and let me know.

Bob Scriver
 
Bob,

I'm not able to make it work. When placing the code on the place you suggested the following error appears (translated from Spanish by me):

Compile Error.
Qualifier not valid

The error signals on blue .picture from

Me.picture.visible = false

The picture was placed through the report properties and the code may not find it.

Thanks a lot,

Carlos F.
 
I misspelled Picture in my posting. If you cut and copied the code then that is the problem. I posted:
Me.Pricture.visible = false

and it should be

Me.Picture.visible = false

Let me know if that was the problem. If not we can work on more.



Bob Scriver
 
This I had noticed, the error message I am receiving is different to the one received by doing the copy paste.

The error comes out when I change from page in the report.
Here at home I cannot print but my computer has color printer installed. I am using this print preview to see if the picture is gone or not.

Thanks,
Carlos F.
 
Carlos, I do not understand. When you say the error happens when you change to page. . . just what do you mean. I wanted you to put that line of code in the On Print event procedure of the Report Footer. This would not trigger on changes pages.

Please clarify.

You see during the Print Preview the picture control is visible until it gets to the last record and then the report footer is executed. In the Print Preview the pictures all show. How when the report footer of the Print Preview executes then the picture control is visible = false so only the data is printed.

Please explain in more detail just what is happening. Are you only previewing and printing one page at a time. I have tried that and it works properly. If more than one page that seems to work also.

Awaiting your reply.

Bob Scriver
 
Bob,

What was meant is that my VBA is not compiling: Me.Picture.visible = false

When executing: DEPURACION "DEBUG" -> COMPILAR 3G
A compile error appears as mentioned before.

Putting this code on the page footer not the report was done in order to see if the picture disappears with a page change. ( This I just figure it now )

"This because the print preview of the color printer shows the image when I place the code on the report footer."

Maybe the code is not been run at all when making a print preview on the color printer. Assuming the print preview of the color printer must be different from the report print preview. To check this, a test will be done at work tomorrow on a laser printer.

The thing is that as my VBA has some instructions on Spanish, maybe this is causing the problem. I tried using Me.Imagen.visible = false but has the same result: The code can’t be compiled.

One more thing that could be miss-understood:
The picture is linked to a file (not embedded) and has a BMP format. This picture can be seen on the background of all the report.

Thank you very much for your patience,
Carlos F.


 
Bob,

What was meant is that my VBA is not compiling: Me.Picture.visible = false

When executing: DEPURACION "DEBUG" -> COMPILAR 3G
A compile error appears as mentioned before.

Putting this code on the page footer not the report was done in order to see if the picture disappears with a page change. ( This I just figure it now )

"This because the print preview of the color printer shows the image when I place the code on the report footer."

Maybe the code is not been run at all when making a print preview on the color printer. Assuming the print preview of the color printer must be different from the report print preview. To check this, a test will be done at work tomorrow on a laser printer.

The thing is that as my VBA has some instructions on Spanish, maybe this is causing the problem. I tried using Me.Imagen.visible = false but has the same result: The code can’t be compiled.

One more thing that could be miss-understood:
The picture is linked to a file (not embedded) and has a BMP format. This picture can be seen on the background of all the report.

Thank you very much for your patience,
Carlos F.

Bob,

What was meant is that my VBA is not compiling: Me.Picture.visible = false

When executing: DEPURACION "DEBUG" -> COMPILAR 3G
A compile error appears as mentioned before.

Putting this code on the page footer not the report was done in order to see if the picture disappears with a page change. ( This I just figure it now )

"This because the print preview of the color printer shows the image when I place the code on the report footer."

Maybe the code is not been run at all when making a print preview on the color printer. Assuming the print preview of the color printer must be different from the report print preview. To check this, a test will be done at work tomorrow on a laser printer.

The thing is that as my VBA has some instructions on Spanish, maybe this is causing the problem. I tried using Me.Imagen.visible = false but has the same result: The code can’t be compiled.

One more thing that could be miss-understood:
The picture is linked to a file (not embedded) and has a BMP format. This picture can be seen on the background of all the report.

Thank you very much for your patience,
Carlos F.



 
Okay, there may be a translation issue here. When I instruct you to use the code
Me.Picture.Visible = False

I am asking you to substitute the actual Name of the control that has the picture embedded in it. The word Picture is not a good name to use when describing a Picture. It can become confusing. If the Name of this special control is for example: ItemPicture Then the code to be put in the Report Footer should be:
Me.ItemPicture.Visible = False

Maybe this is the problem here.

Bob Scriver
 
Bob,

I have just tested the command:

Me.picture.visible = false

On a Laser printer and it works perfectly.

You surely deserve a STAR.

The access version I am using here at work is not on Spanish, so maybe I need to findout the correct syntax for it.

Thanks a lot,
Carlos
 
Carlos, Great!!!!![2thumbsup]

If you don't mind where located. I like to keep track of locations that I have been in contact with here on TT.

Bob Scriver
 
You have your home here at Monterrey, Mexico.
Place of EL CABRITO and INDY CHAMP CAR RACING.

Carlos F.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top