Cant Create Image Edit Control in Access Form

miguelfc

New member
Local time
Today, 15:09
Joined
Oct 4, 2006
Messages
2
Hi,

I've searched a lot and couldn't find an answer to my problem.

I want to have a field in my form that allow me to paste an image from the clipboard to, for example, a Paint field. Then, I want to save that image to a file on a specific folder in my computer via VB.

The reason for this is that I don't want to ask the user to open paint by himself and save the file, probably in the wrong location and with the wrong name.

The first approach was creating an OLE Object directly from the Insert menu and that worked partially. It allowed me to paste the image but there wasn't a way to save it to a file, neither a method for that. It was an incrusted object, and I think that is the reason for that.

Then I tried to create the object by myself via VB, with the instructions:
Code:
Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint.Picture") 'IT STOPS HERE
And with the variation:
Code:
Dim objeto_perfil As Object
Set objeto_perfil = CreateObject("Paint") 'IT STOPS HERE
And neither worked. The error message says it lacks an object.

Then I followed an example from msdn that used a bound frame (view here). The code is:

Code:
    visor_perfil.Class = "Paint.Picture" ' Set class name.
    ' Specify type of object.
    visor_perfil.OLETypeAllowed = acOLELinked
    ' Specify source file.
    visor_perfil.SourceDoc = "C:\RealPath\image.BMP"
    ' Create linked object.
    visor_perfil.Action = acOLECreateLink  'IT STOPS HERE
    ' Adjust control size.
    visor_perfil.SizeMode = acOLESizeZoom

It stops in the action assignation, an says "error 2753 there was an error trying to communicate with the OLE server".

I google a lot and could find much of the Paint.Picture Class.

Anyone has any ideas to overcome this issue? What am I doing wrong?

Thanks in advance!
 
While unfortunately I am unable to help you with your programming problem, I cannot help but wonder why you want to use Access for moving images from the clipboard to a folder on the harddrive. Where does the database come into play?

And why do you think people are too stupid to navigate folders yet assume they know how to paste images from the clipboard?

If all you want to do is save the pictures in a certain location, you may want to try setting the "Start In" folder for your image editing software to the folder where you want the pictures to go.
Create a shortcut to your software on the desktop, or wherever you need it, right-click on it and select "Properties". Paste the path to the desired folder in the "Start In" field, eg.

C:\Documents and Settings\UserX\My Documents\My Pictures​
 
Hi Niniel, thanks for your answer. There's no need for violence here.

I'm trying to implement this because I don't want them to open another more window to do a job that they could do in the same form (they (my classmates) normally have around 20 windows open).

And I didn't mean they are stupid, I just want Standardization.
 
Last edited:
Sorry, I didn't mean to come across as "violent", I was simply puzzled as to what you were trying to do.
It sounds like a total misuse of a database, but I guess it's a good programming exercise. Good luck with it.
 

Users who are viewing this thread

Back
Top Bottom