Problem Printing Images in a Report

N

Nigel

I've created a small database to manage contact details for a vintage car
club. It uses only two tables: one for address and contact details and a
second for the cars each member owns. The tables are called tblMembers and
tblCars. I also have the forms frmMembers and frmCars (a subform).

My problem is when I come to set up my report it doesn't match up the images
properly. Lets say we have 6 members, but only 4 pics of cars, with no pic
for member 1 and 3. When I preview the report, car 6 appears next to member
1 and car 2 appears next to member 3. The other members get the right car
pics. I tried using blank.jpg file for members without a pic of their car,
but it doesn't always work. Any ideas?
 
T

tina

i'm guessing that you have a link to the picture files, stored in a field in
tblCars? and a control in the report that uses that link? have you tried
running code on the report'd Detail section's Format event, to hide the
control when no linking data exists in the table field? something like

Me!PictureControlName.Visible = Not IsNull(Me!TableFieldName)

hth
 
N

Nigel

I'll give it a go. Thanks.

tina said:
i'm guessing that you have a link to the picture files, stored in a field in
tblCars? and a control in the report that uses that link? have you tried
running code on the report'd Detail section's Format event, to hide the
control when no linking data exists in the table field? something like

Me!PictureControlName.Visible = Not IsNull(Me!TableFieldName)

hth
 
N

Nigel

I ended up using and [Event Procedure] as follows:


Start:

On Error GoTo ImageCarError:

If Not IsNull(Me![ImagePath]) Then
Me![ImageCar].Visible = True
Me![ImageCar].Picture = Me![ImagePath]
Else
Me![ImageCar].Visible = False
End If
GoTo Finishup:

ImageCarError:
Me![ImageCar].Visible = False

Finishup:


Thanks kindly for your help.
 
T

tina

you're welcome, and good job! :)


Nigel said:
I ended up using and [Event Procedure] as follows:


Start:

On Error GoTo ImageCarError:

If Not IsNull(Me![ImagePath]) Then
Me![ImageCar].Visible = True
Me![ImageCar].Picture = Me![ImagePath]
Else
Me![ImageCar].Visible = False
End If
GoTo Finishup:

ImageCarError:
Me![ImageCar].Visible = False

Finishup:


Thanks kindly for your help.

tina said:
you're welcome, hth :)


vintage
car details
and a with
no right
car
 

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