Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picture in an Unbound Attachment Control

Status
Not open for further replies.

pavla

Programmer
Jul 10, 2000
32
0
0
GB
I have a bitmap picture stored in an Attachment field (one picture in one Attachment field). - I would like to display this picture on a form bound to another table.

I have put an unbound Attachment control on this form.
I have tried to display the picture by running VBA code:
creating a DAO recordset, DAO.Recordset, and locating the record and field which stores the picture,
then creating another recordset, DAO.Recordset2: DAO.Recordset.Fields(“[name of the field which holds the picture]”).Value,
and then trying to display the picture: [unbound attachment control].DefaultPicture = DAO.Recordset2.Fields(“FileName”).

Access generates an error message 2220: can’t open the file “name of the file”. (I am, therefore, locating the record and attachment field correctly - just need to get at the picture!)

Is there a way of displaying a picture stored in an Attachment field on a form NOT bound to the table containing the Attachment field?

Thank you very much for any help. - Storing pictures in Attachment fields seems such a good idea; surely there must be a way to retrieve them and to display them without binding the attachment controls to the attachment fields themselves.

I do hope there is an answer, thank you, Pavla.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top