how to print an image displayed in an image control using Access program

S

Sudha

I am displaying an image using an image control. I have to provide a print button. On clicking this the user should b
able to print the image displayed in the image control. The image displayed in the image control will be present in
some folder of that computer. Can anyone provide a solution for this pl.?
 
J

Joe Black

Sudha said:
I am displaying an image using an image control. I have to provide a print
button. On clicking this the user should be
able to print the image displayed in the image control. The image
displayed in the image control will be present in
some folder of that computer. Can anyone provide a solution for this pl.?

Hi Sudha

Create a public function in the form that returns the path and filename of
the image.
Public Function CurrentPicture() As String
CurrentPicture = MyImageControl.Picture
End Function

Create a blank report which calls the above function when it opens
Private Sub Report_Open(Cancel As Integer)
Me.Picture = Forms!frmMain.CurrentPicture
End Sub

Then create a button with the following code to open the report
Private Sub btnPrintImage_Click()
DoCmd.OpenReport "rptImagePrint", acViewPreview
End Sub
If you want to print without preview change acViewPreview to acViewNormal.

Regards - Joe
 
S

Sudha

Hello Mr Jo

Thank you very much. Yes this is how it can be done. I have used it. It is working perfectly

With regard
Sudha
 

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