Deling with attachment field types

Richard1980

Registered User.
Local time
Today, 05:12
Joined
Aug 13, 2012
Messages
72
Working with attachment field types

Hello Gents,
I need help or suggestions about this. In my DB there is a table with hundreds of world countries and an attachment type field where I store flags pictures of the countries.
Then I have a form where I want to import the specific flag for the country I select by a combobox.
First question: which field type is better for the flag in the form? Attachment type or other?
Second question: would you use the DLookup function to import the specific flag for the country selected by combobox or other?
Many thanks, bye.

Riccardo
 
Last edited:
If you were to use the Attachment data type then the Attachment control would be the best control for this. By the way I think you mean "which control is better for the flag in the form?" because controls are what you get in forms which are bound to fields.

DLookup cannot extract images. So you need a subform that will display only one record at a time and you filter the subform using it's Filter and FilterOn properties, that is if the form is going to be a Continuous Form. Otherwise if it's a Single Form then you can simply filter the form using the properties I mentioned or directly in the form's Record Source.
 
Oh I forgot to add, instead of using an Attachment data type you're better off just saving the path to the files and using the path as the Control Source of an Image control which will then display the images if the file is found. That way you keep the size of your db as small as possible because your images will not be stored in the db.

See here for more:

http://office.microsoft.com/en-us/a...s-forms-reports-and-controls-HA001147204.aspx
 
Thank you sir, I will give a try with a subform, anyway it does not convince me much. I would like a simple and plain vanilla box where displaying the flag and not only the entire subform structure.
About the image control, it does not suit my thoughts...
Anyway, thanks for your suggestions. Bye.
 
Well if you don't mind your database increasing in size considerably then you may stick to your Attachment field.

It's whatever control you place on a subform that gets displayed isn't it? If you place only an Attachment control that will be the only thing displayed on the subform.
 
No, no DB increasing expected because I have only 200 little .png files (about 10kb each) and no more. About the subform I will try... Thanks.
 

Users who are viewing this thread

Back
Top Bottom