Combobox with OLE Picture

Ottomatic

Registered User.
Local time
Today, 20:11
Joined
Mar 29, 2013
Messages
16
Hi,

I'm searching several hours on this and I'm getting desperate.

I understand that their are several ways to work with pictures and comboboxes. Working with an OLE Picture is not prefered. But I only need to add 5 little signatures. Previous attempts, like trying to connect with my SharePoint site and our server didn't work. So I have only one option left which is to work with an OLE object. Because the pictures (signatures) are just arround 15kb, I think it will not influence my database a lot.

Because I only have about 2 weeks experience working with Access, I can't enable to show the signature (Picture in jpg or bmp) when a person is selected in a combobox. I compared the code with several other posts but all do it very differently.

I have table with 3 fields: Id, Inspector and Signature

Signature is an OLE field. In this field for each inspector I paste his Signature.

In the form I'm trying to show his Signature via a combobox.

But I can't find out how I have to make the connection between the Picture field and the table were the picture is stored. And this in combination with a combobox.

Here is my code were I'm struggling with:

Option Compare Database
Option Explicit

Private Sub Inspector_AfterUpdate()

Select Case Inspector.Value

Case "Inspectors_Name"
Me.Signature.Picture = Me.Inspector.Column(2)

Case "Colin Jean-Philippe"
Me.Signature.Picture = Me.Inspector.Column(2)

End Select

End Sub


Thanks in advance, Otto
 
You don't need to store the isgnature in the table as it rendered referentially.

The inspector = 1 signature therefore InspectorID1 = Signature1

AfterUpdate create a Function to GetSignature

Simon
 
Hi Simone,

Would you be so kind to fill out this small file in attachment?
Because I didn't understood your reply.
I didn't put any code in it.

Many thanks in advance. Otto
 

Attachments

I have made some signatures, (no resemblance is intended).

I have a directory C:\Databases\Test\

there are two files 1.png and 2.png these have been included. There is a qryPeople and the ImageFile may need to be modified to the location of your project.

Simon
 

Attachments

Hi Simon, thank you for your effort. But I want to avoid to store the pictures or signatures on a local drive or network drive. That's why I'm thinking to put those in the database itself. The reason for this is the database will be distributed to different people. They will have to download the database from a SharePoint site to their local computer. Each time their is an update they will be alerted that they have to download a new database. But If I have to give them a second instruction to save the pictures in attachement on their local drive, I'm affraid they don't going to accept that. Saving the signatures in the database works with OLE but I can't say to the combobox when you click this person, this signature should appear. Would you have something to achieve this? Many thanks in advance, Otto
 
Last edited:
Hi Simon, I have made a small, but not complete, example were the OLE pictures are in the database itself. But I find this solution not good because I have about 43 reports and 43 forms, via this way I have to copy and paste the code 43 times for each and also for the pictures. That's why I want to place those pictures in a table and go from there to each report or form. But as you already know I can't achieve this. Regards, Otto
 

Attachments

I have never stores images in a database as I have over 20,000 images and besides when I looked at this OLE method it converted images to bitmaps that is blotware.

Simon
 
Ok, no problem. But If you never worked with this OLE method, maybe you have worked with a SharePoint list? If you did, would you have an idea how to pull the pictures from a SharePoint list when an item in the combobox is selected? Regards, Otto
 
I would get out of bed for Sharepoint I used a Terminal Server instead.

Simon
 
Found a (Solution). Based on my file "combobox with OLE Pictures (2)". I pasted that code in a Report as an event on load. When a button is pressed for printing it triggers a report, the Inspectors who made the inspection, will see his Signature appear in the report. Regards, Otto
 
Hi Simon,

I see that you are answering questions about pictures in forms and reports some few years. Would it be possible to do just one final effort for me? The file you sended me, I'm going to apply that same logic. But I couldn't figure out how I can create a report based on the combobox with the picture. Would you add the code into file in attachment for creating a report based on that combobox with a picture? Many thanks in advance, Otto
 

Attachments

Otto,

Forgive me, create a report of what? A report of a single record or a report with the signature?

Simon
 
Hi Simon, Glad to hear from you. Regarding your question, a report with the signature in the report footer based on the combobox selection, if you will. Many thanks in advance, Otto (I've been thinking on the test file some days now and how you did this, and I'm beginning to understand the logic behind...difficult stuff for me)
 

Attachments

Otto,

Sorry for the delay in replying.

I used a slightly different technique. I have used used the People Table you will need to link to via Query but the result will be the same.

This works for Access 2007+.

Simon
 

Attachments

Hi Simon,

Many thanks! (you don't have to give your apologies, it's nice to hear from you) I will study your solution, probably whole weekend, to understand it. Again, many thanks, Otto
 
Ok, found it,this wasn't a difficult one. Have a nice weekend!
 

Users who are viewing this thread

Back
Top Bottom