load loads of pics automatically

  • Thread starter Thread starter matttt
  • Start date Start date
M

matttt

Guest
OK so this is my problem.

I have 1500 Jpeg files, each one beloging to a separate record in a single table. The record Primary Keys matches the name of the corresponding Jpeg. How do automate the process of linking each jpeg to its record?

Thanks Matt
 
You mean you want to show the corresponding pict to each record in form or in report, right?

In your form, just add the Image control and name it Pict (or whatever you like) then put the code below.

Private Sub Form_Current()
Form_Load
End Sub

Private Sub Form_Load()
On Error Resume Next
If Me.YourPrimaryKey = "" Or IsNull(Me.YourPrimaryKey) Then
Me.Pict.Picture = ""
Else
Me.Pict.Picture = "c:\pictures\" & Me.NicName & ".JPG"
End If
End Sub
 
Have a look at this. I asked the same question some time ago and this example was posted in return.

HiH

Dave
 

Attachments

Thanks both

Both solutions seem to avoid actually linking the Jpegs to a bound control - instead using text equivalents to show the path of the picure file location.

This may be OK - but its not the same as automating the process of importing the Jpegs into the access environment. What if I wanted to embed rather than link the files - would I then have to import each one individually.

Anymore help to clarify this would be appriciated

Matt:(
 
Why embed the jpegs??

You are going to see a dramatic size "blowout" if you embed lots of images.

By using TimK's method, you will get the best of both worlds.

ie: Store the image path, and display the image on opening the forms etc.

Brad.
 
Thanks

Just wanted to hear it in black and white.

So this the recommended method? - should I ever use an OLE field to link to a picture?

Matt
 
Last edited:

Users who are viewing this thread

Back
Top Bottom