Hello:
Since Attachment data type and Attachment control are new to Access 2007, limmited programatic/sample-code availbale on the web.
So looking for assistance with Attachemnt Data Type with Unbound Attachment Control in Access 2007.
On a form, an Attachment control has been added, which is unbound (note, the control must remain unbound). Programatically (VBA), how would an attachment (in this case a pdf) stored within a table, be "populated" within the form?
Expanding on the question, what aspects of the Attachment data type (archived within a table which have properties of .FileData , .FileType, and .FileName etc) would be used in assignment to the Attachment control within form? Which of the control's properties need setting?
With "Me.ControlAttachment" being the form's attachment control, here is some simple code for trying to describe the issue . . .
Dim RecSet As DAO.Recordset
Dim rstAttachment As DAO.Recordset
Set RecSet = CurrentDb.OpenRecordset("SELECT PDFid, myAttachment FROM tPDF WHERE PDFid =1")
Set rstAttachment = RecSet!myAttachment.Value
' Help Start
Me.ControlAttachment.???? = rstAttachment!????
' Help End
rstAttachment.Close
RecSet.Close
I have exhaustively searched the web on a few occasions, with no success. Ironically, some similar posts on this issue have occurred in various forums, which have all gone un-answered.