Solved Don't display EMF in Attachment control with data from subform

AFila

New member
Local time
Today, 08:51
Joined
Jan 9, 2021
Messages
4
I can't display content of graphic file(EMF format) in Attachment control on main form.

Attacment's data source refer to field on subform. Maybe I specify wrong reference? On subform control Attachment displays image correctly.

I try different references for Attachment's control data source:

=[Form2].[Form].[FLAGS_EMF]

=[Form2].[Form].[FLAGS_EMF].FileData

Field [FLAGS_EMF] has type Attachment in database MS ACCEESS 2010
 

Attachments

  • Form_EMF.png
    Form_EMF.png
    8.4 KB · Views: 221
  • Form_EMF_constr.png
    Form_EMF_constr.png
    25.9 KB · Views: 220
you can use a Query and use the Attachment column as Controlsource (bound) of the textbox.
or you can SaveToFile the Attachment and use Image Control to show the emf file.
 
you can use a Query and use the Attachment column as Controlsource (bound) of the textbox.
or you can SaveToFile the Attachment and use Image Control to show the emf file.
Thanks for answer. I think use method Attachment.SaveToFile is not good idea.
What do you mean "use Query"? Use another query in controlSource of main Form?
I would like get data for Attachment control on main Form from subform's query. Is it possible?
 
According to MS Attach files and graphics to the records in your database - Access (microsoft.com), EMF files can be used in attachment fields.

Nevertheless, most developers recommend that attachment fields (a special type of multivalued field) should be avoided. Using them will embed files in your database causing the Access file size to rapidly increase and reduce performance. Instead store the paths to external files
 
there are two forms on the demo, BOUND_FORM and UNBOUND_FORM.
see the Current event of the SUBfrm.
 

Attachments

UNBOUND_FORM - I understand. Thank you!
BOUND_FORM - gives Error: "Could not find field: IMAGE6"
1610276652594.png
 
Thank you very much!

This is what I was looking for.
 

Users who are viewing this thread

Back
Top Bottom