Connecting Tech Pros Worldwide Help | Site Map

attaching picture to table

  #1  
Old January 1st, 2006, 04:05 AM
rb
Guest
 
Posts: n/a
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


  #2  
Old January 1st, 2006, 10:55 PM
Anton
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Minor Error with Code for Attaching Images to a Form Forsi answers 1 August 15th, 2008 12:33 PM
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help gunimpi answers 0 January 10th, 2007 08:55 PM