Display JPEG picture

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
 
L

Larry Linson

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
 
L

Larry Linson

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
 
V

Vsn

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
 

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