Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234

    Add a picture of employees to their db file

    This is a picture of frmEmployee. I'd like to be able to add a picture of the employee that shows when the individual employee's information is showing on the screen. Is this possible?


    Click image for larger version. 

Name:	frmemployee.png 
Views:	13 
Size:	42.1 KB 
ID:	21780

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    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.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    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.

  4. #4
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    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?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    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.

  6. #6
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    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?

  7. #7
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by June7 View Post
    Not a textbox, an Image control. See my previous post.
    I was responding to the other poster as you were answering. I hadn't read your post yet when I wrote that last one.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    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.

  9. #9
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by June7 View Post
    How much data do you expect to accumulate?
    A lot, I'm guessing. We have well over 100 employees, and my boss wants a picture to pop up whenever he brings up an employees data on frmEmployee.

  10. #10
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by June7 View Post
    The attachment type field must be added to table in table design


    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

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    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.

  12. #12
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Yes, we're using .mdb files. Our BE is .mdb.

  13. #13
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Ok, someone had saved it to being compatible with 2003. I saved it as 2007, and now there's "attachment" as an option.

  14. #14
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    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.

  15. #15
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Quote Originally Posted by June7 View Post

    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
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. save pasted picture to a jpeg file
    By jscriptor09 in forum Programming
    Replies: 4
    Last Post: 06-24-2014, 07:25 PM
  2. Employees in same entity
    By cathal1292 in forum Access
    Replies: 3
    Last Post: 05-05-2014, 02:26 PM
  3. No More Than 4 Employees Allowed on Form
    By burrina in forum Access
    Replies: 1
    Last Post: 10-25-2012, 10:54 PM
  4. Replies: 7
    Last Post: 06-18-2012, 11:31 AM
  5. Picture / Vedeo File Attachment
    By rkalapura in forum Forms
    Replies: 3
    Last Post: 06-14-2012, 01:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums