kaiana,
It sounds to me that you may be attempting to embed the actual image itself into the table (via a bound control). If this is the case then, I dont think its a good idea; it makes the database LARGE and potentially unreliable.
Better idea is just to hold the filename in the table (eg. as a 50 character text field), and make this a bound field to the form. Lets call the field PhotoFileName, and give it the same Control name in the bound form.
Add a button called btnShowPicture to the form. Also add an UNBOUND image to the form; call it imgPicture. Make sure the Picture property is "(none)", and the PictureType property is "Linked"
Then, add the following code to the respective events:
[tt]
Private Sub Form_Current()
Me!ImgPicture.Picture = me!PhotoFileName
End Sub
Private Sub btnShowPicture_Click()
Me!ImgPicture.Picture = me!PhotoFileName
End Sub
[tt]
This code will load the picture into the control whenever an existing record is navigated to. It will also allow you to 'refresh' the display if a new filename is provided (via the bound text field, which should be available on the form).
Note the following:
(a) the code in the above two routines is identical
(b) I have not included any error handling; eg. if the picture file doesnt exist. Use the dir() function to check if the file exists.
(c) If you use a file naming convention, you could do this without needing a new text field; for example you could place all images in a single known folder, and name them according to the (say) unique employeeId associated with a person. Assuming an id is never re-used, this would work quite well, and would mean that the filename could be derived without the need for the extra field. All you need do is place the image in the special image folder, and make sure that its appropriately named.
hope this solves it,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)