Display JPEG picture

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I have a report to display a commune profile include Commune Name other
statistic. I have added and Image control on the report to display commune
map (in JPEG format).

I have included

Private Sub Report_Open(Cancel As Integer)
Me.Image31.Picture = Me.CoomunePICPATH
End Sub

I received a Runtime error # 13 (Type mismatch).

Why I got this error message

SF
 
Probably you got it because the Control from which you were trying to obtain
the path was not, as Controls generally are not, active and populated at the
time the Open event is fired. Try putting that code in the OnCurrent event,
instead.

Larry Linson
Microsoft Access MVP
 
Oops, sorry... you'd use the OnCurrent event in a Form, but in a Report,
you'd put this code in the Print event for the Report Section in which the
Control Image31 appears.

Larry Linson
Microsoft Access MVP
 
You could use code like this:-

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
On Error Resume Next
Me.imgTest.Picture = Me.CoomunePICPATH

End Sub


Ludovic
 
Back
Top