Pictures in reports

  • Thread starter Thread starter OveB
  • Start date Start date
O

OveB

I have a base in Acc2000 with museum items, some with one or two pictures
and some without any picture. The pictures are stored in a separate folder
with names containing four digits, the same as the item# (NR). In the Form I
have created a place for each picture with the picture tool and then given
it a picture name source. In the Forms properties I have then under At New
Record (Events) written a code:
Private Sub Form_Current()
If Me.NewRecord Then
Me![Mainpict].Picture = "C:\Pic\Sn0000.jpg"
Exit Sub
End If
Dim Plats As String
Dim NRPadded As String
NRPadded = Right ("000" & CStr (Me!NR), 4)
Plats = "C:\Pic\Sn" & NRPadded & ".jpg"
If Dir(Plats) = "" Then Plats = C:\Pic\Sn0000.jpg"
Me![Mainpict].Picture = Plats
End Sub

(Above I have omitted the lines for a second picture as they are much the
same.)

This works very well. But now I would like to have reports, one page for
each item# or NR. I have failed to create a proper code and where to put it.
I would very much appreciate your help on this, either a link to the Form or
a new code and a place for it.

Regards/Ove
 
I'm sorry, but I had some trouble understanding your question. It seems to
me that you said you had solved the problem of printing the pictures, but
that you wanted each item # to start a new page. Is that correct?

If you are grouping on item #, then in the Group Header properties, set
Force New Page under the Format tab. If item # is what determines a Detail
Section, see Force New Page for the Detail Section.

If you want everything for a given item on that page, that is a matter of
designing your report so that it all fits.

Larry Linson
Microsoft Access MVP
 
Thanks to both of you for your answers.
I succeeded by entering codes of the same type as mentioned in my first cry
for help, in Details Properties at Format.
I can now print all desired propertities on one page from any item#. When
clicking on the name of the report I get the question which item# and then I
get that one with photos and all.

For "slyckboy" I want to mention that I was not able reach the page
mentioned. When introducing the entire address it ended up in a general
Swedish Microsoft page. Did you mean to point at a knowledge base paper?

Regards/Ove

Larry Linson said:
I'm sorry, but I had some trouble understanding your question. It seems to
me that you said you had solved the problem of printing the pictures, but
that you wanted each item # to start a new page. Is that correct?

If you are grouping on item #, then in the Group Header properties, set
Force New Page under the Format tab. If item # is what determines a Detail
Section, see Force New Page for the Detail Section.

If you want everything for a given item on that page, that is a matter of
designing your report so that it all fits.

Larry Linson
Microsoft Access MVP

OveB said:
I have a base in Acc2000 with museum items, some with one or two pictures
and some without any picture. The pictures are stored in a separate folder
with names containing four digits, the same as the item# (NR). In the
Form
I
have created a place for each picture with the picture tool and then given
it a picture name source. In the Forms properties I have then under At New
Record (Events) written a code:
Private Sub Form_Current()
If Me.NewRecord Then
Me![Mainpict].Picture = "C:\Pic\Sn0000.jpg"
Exit Sub
End If
Dim Plats As String
Dim NRPadded As String
NRPadded = Right ("000" & CStr (Me!NR), 4)
Plats = "C:\Pic\Sn" & NRPadded & ".jpg"
If Dir(Plats) = "" Then Plats = C:\Pic\Sn0000.jpg"
Me![Mainpict].Picture = Plats
End Sub

(Above I have omitted the lines for a second picture as they are much the
same.)

This works very well. But now I would like to have reports, one page for
each item# or NR. I have failed to create a proper code and where to put it.
I would very much appreciate your help on this, either a link to the
Form
or
a new code and a place for it.

Regards/Ove
 
. . . I was not able reach the page
mentioned. When introducing the
entire address it ended up in a general
Swedish Microsoft page. Did you mean
to point at a knowledge base paper?

Word wrap in my Output Express forced me to copy and paste to make a
complete address out of that, but when I did, it displayed Microsoft
Knowledge Base Article 148463. You might have better luck just going
directly to http://support.microsoft.com and searching on the article
number.

Larry Linson
Microsoft Access MVP
 
Back
Top