By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 1,916 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Cant Create Image Edit Control in Access Form

P: 1
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:
Expand|Select|Wrap|Line Numbers
  1. Dim objeto_perfil As Object
  2. Set objeto_perfil = CreateObject("Paint.Picture") 'IT STOPS HERE
  3.  
And with the variation:
Expand|Select|Wrap|Line Numbers
  1. Dim objeto_perfil As Object
  2. Set objeto_perfil = CreateObject("Paint") 'IT STOPS HERE
  3.  
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:

Expand|Select|Wrap|Line Numbers
  1.     visor_perfil.Class = "Paint.Picture" ' Set class name.
  2.     ' Specify type of object.
  3.     visor_perfil.OLETypeAllowed = acOLELinked
  4.     ' Specify source file.
  5.     visor_perfil.SourceDoc = "C:\RealPath\image.BMP"
  6.     ' Create linked object.
  7.     visor_perfil.Action = acOLECreateLink  'IT STOPS HERE
  8.     ' Adjust control size.
  9.     visor_perfil.SizeMode = acOLESizeZoom
  10.  
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!
Oct 4 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
Hi

In fact you want to export image from Access to bitmap File don't you?

Or maybe to import?

In ole Class you can try to assign "Bitmap"

:)
Oct 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.