Label Picture

S

scott

I've created an access report that will print labels. There are 6 labels on
each page using 2 columns.

I have an image box control that I'm setting to a path name of the picture
using code below.

Currently, I have 50 records, but only the first 10 records have an image
path set in the table. When I open my label report, the first 10 records
display the correct picture, but starting with record 11 through 50, those
images display the last or 10th record's image.

How I set the .picture property to nothing if there is no path name in the
picture field?

CODE ***********

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

pathName = CurrentProject.Path

If Len(Me.artImageName) > 0 Then
Me.imgArt.Picture = pathName & "\images\" & Me.artImageName
Else
Me.imgArt.Picture = ""
End If
End Sub
 
F

fredg

I've created an access report that will print labels. There are 6 labels on
each page using 2 columns.

I have an image box control that I'm setting to a path name of the picture
using code below.

Currently, I have 50 records, but only the first 10 records have an image
path set in the table. When I open my label report, the first 10 records
display the correct picture, but starting with record 11 through 50, those
images display the last or 10th record's image.

How I set the .picture property to nothing if there is no path name in the
picture field?

CODE ***********

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

pathName = CurrentProject.Path

If Len(Me.artImageName) > 0 Then
Me.imgArt.Picture = pathName & "\images\" & Me.artImageName
Else
Me.imgArt.Picture = ""
End If
End Sub

Can you work with this?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
pathName = CurrentProject.Path

If Len(Me.artImageName) > 0 Then
Me.imgArt.Picture = pathName & "\images\" & Me.artImageName
Me.imgArt.Visible = True
Else
Me.imgArt.Visible = False
End If
End Sub
 
S

scott

that works.

fredg said:
Can you work with this?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
pathName = CurrentProject.Path

If Len(Me.artImageName) > 0 Then
Me.imgArt.Picture = pathName & "\images\" & Me.artImageName
Me.imgArt.Visible = True
Else
Me.imgArt.Visible = False
End If
End Sub
 

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