Hi,
Thanks for the excellent help in getting photo's "into" a database without actually loading them. I downloaded the example database from:
http://www.database-wizards.com/access_97_sample_library.htm#P
With a little playing around I incorporated it into my own existing database which eventually will have thousands of photos. The database was growing larger by the second without this help.
I still need a little help however, and that is in the form that i am using. I have a main form with a continuous subform showing a picture of the equipment with all relevant data. Each grouping of photos refers to a particular company. The subform is linked to the main form via a company ID.
My problem is that the subform will show all the records but will only show one picture (the same) on all records.
If I make the subform single view it works as it is supposed to.
Below is the code that I have used to date with AGFE being the equipment table:
Option Compare Database
Option Explicit
Dim filename As String, pathname As String
Dim db As Database
Private Sub Form_Activate()
'find the path of the current database
'which is where the jpegs are stored
Set db = CurrentDb
filename = db.Name
pathname = Mid(filename, 1, Len(filename) - Len(Dir(filename)))
End Sub
Private Sub Form_Current()
On Error GoTo Err_cmdClose_Click
'set the picture path
Me.ImgAGFE.Picture = pathname & Me.Photo
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
If Err.Number = 2220 Then 'can't find the file
Resume Next
Else
MsgBox Err.Description
Resume Exit_cmdClose_Click
End If
End Sub
Private Sub PHOTO_AfterUpdate()
Me.RecordsetClone.FindFirst "[AGFEID] = " & Me!AGFEID
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
I would be very appreciative if someone could point me in the right direction for getting each individual picture to show on its particular record.
Regards
Gazza