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
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