View image in the report

le888

Registered User.
Local time
Today, 09:56
Joined
Dec 10, 2003
Messages
344
hi,

I have search in this this form and I didn't fint anything on it. My images are linked by a path file and I cann't see my image in the report what is the problem?



Le888
 
In the ON Format event of the Detail band set the Picture property of the Image control to the image file path.
 
ScottGem said:
In the ON Format event of the Detail band set the Picture property of the Image control to the image file path.

My image on the form has the following code and this works fine.

Code:
Private Sub Form_Current()
On Error GoTo HandleErr
  
  If Not IsNull([AmmImage]) Then
    Forms!frmAmm![ImgPicture].Picture = [AmmImage]
    SysCmd acSysCmdSetStatus, "Image: '" & [AmmImage] & "'."
  Else
    Forms!frmAmm![ImgPicture].Picture = ""
    SysCmd acSysCmdClearStatus
  End If
  Exit Sub

HandleErr:
  If Err = 2220 Then
    Forms!frmAmm![ImgPicture].Picture = ""
    SysCmd acSysCmdSetStatus, "Can't open image: '" & [AmmImage] & "'"
  Else
    MsgBox Err.Description, vbExclamation
  End If
End Sub

Can I put this code in my report? If yes, where should I put ?

Le888
 
Yes, I told you where to put it. In the On Format event.
 
ScottGem said:
Yes, I told you where to put it. In the On Format event.

Yes, I have try to put in the On format event, but a message popup " cann't find "AmmImage". I have also, change Forms!frmAmm to Reports!RepAmm and it doesn't work too.

Le888
 
Check the actual names of the controls on the report and use Me.controlname
 
ScottGem said:
Check the actual names of the controls on the report and use Me.controlname

No success, message popup "cann't find reference "l" "

Le888
 
Just a thought (this happened to me) are you sure your printer settings aren't affecting this?

For me, once I changed from Fast Draft to Normal, pictures printed fine. You may want to check your settings. It took me ages to find this out!
 
richary said:
Just a thought (this happened to me) are you sure your printer settings aren't affecting this?

For me, once I changed from Fast Draft to Normal, pictures printed fine. You may want to check your settings. It took me ages to find this out!

My problem is in the view mode report, I don't even see the image.

Le888
 
The logic is the same for a report as for a form. You use an unbound Image control and set the Picture property of the control to the path to the image. The only difference should be the actual object names and the use of the On Format event instead of On Current.
 
ScottGem said:
The logic is the same for a report as for a form. You use an unbound Image control and set the Picture property of the control to the path to the image. The only difference should be the actual object names and the use of the On Format event instead of On Current.

Can you give me the syntax of the code?

Le888
 
You have the syntax. That's why I said the logic is the same.
 
Well, as I mentionned, this don't work. What is the syntax for report?

For the form : Forms!frmAmm![ImgPicture].Picture = [AmmImage]

For the report : Reports!Rep![ImgPicture].Picture = [AmmImage]

If you tell me the above is correct, no, my popup an error message.

Le888
 
I told you, use the ME qualifer instead of fully qualifying the control name.

Me!ImgPicture = AmmImage
 
glad to assist. I always use ME unless I'm referring to a control on an external object.
 

Users who are viewing this thread

Back
Top Bottom