I would store the path of the picture as text in a text field. I would use the table where the SSN field is. you can add a field in that table and store the relevant path there.
A small amount of VBA could update the picture property of an Image Control.
Options:
1. Embed image in Attachment type field and use Image control bound to the field
2. Store in text field full path and file name string of external image file and bind Image control ControlSource property to the text field
3. Store just the file name of image file in a text field or if the image has the same name as some other data, such as EmployeeID, reference that field with expression that concatenates folder path in Image control ControlSource property
="R:\folder path\" & [EmpID] & ".jpg"
No VBA necessary unless you need to build for backwards compatibility or migration to another db environment.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok, just to make sure I understand, the table where the SSN field is tblEmployee - which is the control source for the entire form. So if I add a field to tblEmployee with the path to the picture, and a text box with the same path, the picture will automatically display?
Not a textbox, an Image control. See my previous post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok, so right away an issue. When I click 'design mode' of frmEmployee, the attach option is not available. Or is that not how to add an attachment type field?
The attachment type field must be added to table in table design.
Then modify form to add the control bound to that field. Easiest is to drag field from the Field List.
Be aware that Access has 2GB size limit. Embedding files can use that up fast. How much data do you expect to accumulate?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I'm adding the field to tblEmployee in design mode, but it's not giving me "attachment" as a data type. My options are: Text, Memo, Number, Date/Time, Currency, AutoNumber, Yes/No, OLE Object, Hyperlink, or Lookup Wizard
That's odd. I am sure the attachment type field was introduced with Access 2007.
Is this a split db? Are you still using mdb files?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes, we're using .mdb files. Our BE is .mdb.
Ok, someone had saved it to being compatible with 2003. I saved it as 2007, and now there's "attachment" as an option.
craaaapppppp... Ok, so I can't change it to 2007. Apparently the entire db was built based on Access 2003, so nothing in the FE is compatible with a 2007 BE.
Ok, so going with option 2:
Step 1: I create a text box with the full path to the image.
Step 2: Bind image control ControlSource property to the text field
Not 100% sure how to do step 2, but I'll see if I can figure it out.