Attachment field on the form is represented by a Picture (1 Viewer)

henryihunter1954

Registered User.
Local time
Today, 12:44
Joined
Mar 2, 2016
Messages
89
Hello.

Thanking in advance for viewing this thread.

The form has a field that is an attachment. At this time, the attachment is viewed as the type of file that it has in it, (Word doc icon, Powerpoint icon, etc.)

I would like for the attachment field to be a picture of the Client/Customer or any other type of picture.

Appreciate suggestions.

Thanks
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:44
Joined
Feb 28, 2001
Messages
27,223
For starters, your issue will be what is defined as the "standard" image viewer software for the file type. If you have a .JPG file, possible defaults include PAINT, IMAGE VIEWER, and MEDIA VIEWER.

The control panel gives you an insight into the applications associated with each file type. It potentially varies from workstation to workstation because it is a registry entry in the HKEY_LOCAL_MACHINE/SOFTWARE hive.

Beyond that, if you attach the picture in one of the picture-capable formats such as but not limited to .JPG, Access should behave normally and pick the associated application based on the attachment file's type.

There IS an easier way, though. If you have the pictures as .JPG or other similar formats in a folder where the database resides, or a child folder thereof, you can do just store the text of the file name, generate the device/path specification, and load that file name to the image control's .Picture property. You don't need an attachment; all you need is the file name. By the way, storing pictures as attachments chews up database space. Storing the file separately in a child folder and then just storing the name.type in your table, you can easily make that work and yet avoid database bloat due to memory-intensive attachments.
 

henryihunter1954

Registered User.
Local time
Today, 12:44
Joined
Mar 2, 2016
Messages
89
Thank you so much for your suggestions.

I have videos, powerpoint shows, documents and pictures stored in the attachment. (Depending on the client/customer)

Each client/customer has an attachment that can have a variety of activities in the attachment.

Thank you once again.
 

moke123

AWF VIP
Local time
Today, 15:44
Joined
Jan 11, 2013
Messages
3,927
As doc man has said storing objects in an attachment field bloats your database. If you are storing Pictures and Videos this has the potential to bloat your database quickly to the 2gb limit.

Many, if not most, developers avoid the attachment fields and store these objects in folders outside the database and only store the names or Paths to these objects.

to have the picture of a client in your form you would use an image control and use the stored path to populate the control as doc stated. You can also open any type of file such as powerpoints or video with code, perhaps listing the objects in a listbox.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:44
Joined
Feb 28, 2001
Messages
27,223
Moke is right. If you have a hyperlink to the object, it can be external to the database and yet still be opened by it. Again, the file's type will cause the Windows "Associations" to kick in and define what app is actually opened. Attachments are just space killers, and modern graphics attachments tend to be VERY large.
 

henryihunter1954

Registered User.
Local time
Today, 12:44
Joined
Mar 2, 2016
Messages
89
Thank you all for the suggestions.

I am going to give the suggestions a try.

I hope one day I can be of service as you all are helping me.

Again, thanks for the great support.
 

Users who are viewing this thread

Top Bottom