Connecting Tech Pros Worldwide Forums | Help | Site Map

attaching picture to table

rb
Guest
 
Posts: n/a
#1: Jan 1 '06
I am making a simple inventory control db. I want to include a picture of
the item in each record. The picture will be from digital camera and in jpg
format. I want to be able to browse and choose the picture as i am inputting
info about each item. It would be best if the picture was imbedded into the
db rather than a link to jpg file.
thanks for any help
ron



Anton
Guest
 
Posts: n/a
#2: Jan 1 '06

re: attaching picture to table


Hi rb,

In my opinion embedding images in a table is BAD; causing massive
bloat. I would (and do):

a) open the file selection dialog
b) have the user select the image file
c) copy the selected file to an image directory in the db directory
d) rename the copied file to the primary key value of the active record

then when you want to refer to the image you can do something like:

If Len(Dir$(CurrentProject.Path & "\Photos\" &
Forms!frm_Main!txt_ProdID & ".jpg")) = 0 Then
Forms!frm_Main!Image56.Picture = CurrentProject.Path & "\None.jpg"
Else
Forms!frm_Main!Image56.Picture = CurrentProject.Path & "\Photos\" &
Forms!frm_Main!txt_ProdID & ".jpg"
End If

Hop this helps :)

Closed Thread