0

I´m creating a form that displays the info of all of the employees, including their photo.

When in design view, I've tried using an image control and defining in its control source. See image control in form + property sheet

However, when I change to form view and navigate the employees records, their photo isn´t shown.

I've tried changing the field (where the photos are stored) data type to text, instead of hyperlink (as shown in this youtube video: https://www.youtube.com/watch?v=f5ZOOMrDjtU ) but the photos still do not appear.

The photos are stored as hyperlinks, that show the file path, and if i'm in datasheet view of the table, I can click on the employees photo hyperlink and it opens their photo.

Also, in access options, I have this picture property storage format selected: see the option selected and the images are jpg files.

Does someone know how I can solve this issue? What could I have done wrong?

Thank you.

June7
  • 19,874
  • 8
  • 24
  • 34
ana
  • 15
  • 4
  • A true hyperlink in Access is made of 3 parts separated by # character. This won't work in Image control. Did you simply convert the hyperlink field to a text type or did you also re-enter the data as a full path string? Image control with ControlSource set to field with file path works for me. – June7 Dec 16 '18 at 21:15
  • I've deleted the data from the photos, changed the data type to text and re-entered the data. Deleted and added a new image control to the form and it worked. Thank you! – ana Dec 16 '18 at 23:25
  • More info https://stackoverflow.com/questions/50207997/access-form-abc-picture-xyz-jpg-makes-listbox-textboxes-blink-once/50269085#50269085 – June7 Dec 16 '18 at 23:51
  • @June7 Consider adding that as an answer. It's certainly distinct from that linked question, and it's a valid answer to this one. – Erik A Dec 17 '18 at 12:07

1 Answers1

0

A true hyperlink in Access is made of 3 parts separated by # character.
display text # file name # any reference within the file
More info http://allenbrowne.com/casu-09.html

The hyperlink structure won't work in Image control ControlSource property and can't simply convert the hyperlink field to a text type as the resulting string will not be a valid file path. Either manually enter correct image file path or use string manipulation code to extract file path part from the hyperlink field and save to a text field (x represents fieldname):
Mid(Left(x,InStrRev(x,"#")-1),Instr(x,"#")+1)

On second thought, that expression could be in the ControlSource property so the hyperlink field could be retained as is and a text field not needed.

More info on expressions in ControlSource property: Access Form: `abc.Picture="xyz.jpg"` makes listbox & textboxes "blink" once

June7
  • 19,874
  • 8
  • 24
  • 34