468,309 Members | 1,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,309 developers. It's quick & easy.

Embedding Picture problem

Lyn
I am trying to embed a picture into a Bound Object Frame (Me!Photograph)
with the following code which is based on MS article
http://support.microsoft.com/?id=158941:

strPathname = "C:\photo.bmp"
Me!Photograph.Class = "Paint.Picture"
Me!Photograph.OLETypeAllowed = acOLEEmbedded
Me!Photograph.SourceDoc = strPathname
Me!Photograph.Action = acOLECreateEmbed

I get the following helpful error message (Error 2793) when the .Action
statement is executed:

"Microsoft Office Access can't perform the operation specified in the Action
property of the Visual Basic procedure you're trying to run."

I am using Access 2003 under WinXP.

I am not sure if I have the right value for .Class for a .bmp object, or if
I should be using .OLEClass instead (or as well). I don't need to edit the
picture from this form or table -- just to store it and display it.

Can anyone see what I am doing wrong? Or point me to a better tutorial for
this?

TIA for any help.

--
Cheers,
Lyn.
Nov 13 '05 #1
2 8149
Lyn
OK, I have resolved the initial problem. Unfortunately the information I
gave would not have helped. The problem was that the Bound Object Frame was
not visible at the time of attempting to embed. Making the control visible
allowed the embedding to proceed. Stupid me!

However this has just raised a new problem, so I still need some help...

The size of the Frame on the form is set to Width 5 cm (2") and Height 6 cm
(~2.2"). The embedded picture appears as a chunky square thumbnail with the
filename in large font underneath. The size of the thumbnail and font seems
to adjust automatically to fit the filename in the width of the Frame. That
is, a short filename = large thumbnail and font; long filename = tiny
thumbnail and smaller font. Naturally, I just want the picture content
(without the filename) to fill the Frame completely.

Some control property settings:
Size Mode: Zoom
Display Type: Content
Update Options: Manual
OLETypeAllowed: Embedded
Class: Paint.Picture
AutoActivate: Manual
Verb: 0

This problem is also occurring using the Insert->Object... menu item and
selecting Create from File. However, when I first started working on this
project I was able to use Insert->Object to insert just the full size
picture. I still have a number of early records with the full size picture.
That was a few months ago. Obviously something has happened since then to
change things. There must be an option or property that has changed, but I
can't find it.

Please, can anyone shed some light???

One other thing... When embedding, I get the hourglass icon for a good 20
seconds before the picture appears. I don't remember such a long delay when
I was first working in this area. Is this delay normal (my test database is
very small)???

--
TIA,
Lyn.

"Lyn" <lh******@ihug.com.au> wrote in message
news:d4**********@lust.ihug.co.nz...
I am trying to embed a picture into a Bound Object Frame (Me!Photograph)
with the following code which is based on MS article
http://support.microsoft.com/?id=158941:

strPathname = "C:\photo.bmp"
Me!Photograph.Class = "Paint.Picture"
Me!Photograph.OLETypeAllowed = acOLEEmbedded
Me!Photograph.SourceDoc = strPathname
Me!Photograph.Action = acOLECreateEmbed

I get the following helpful error message (Error 2793) when the .Action
statement is executed:

"Microsoft Office Access can't perform the operation specified in the
Action property of the Visual Basic procedure you're trying to run."

I am using Access 2003 under WinXP.

I am not sure if I have the right value for .Class for a .bmp object, or
if I should be using .OLEClass instead (or as well). I don't need to edit
the picture from this form or table -- just to store it and display it.

Can anyone see what I am doing wrong? Or point me to a better tutorial
for this?

TIA for any help.

--
Cheers,
Lyn.

Nov 13 '05 #2
Lyn
OK, I have now resolved the latest problem. I had "Paint.Picture" as the
value for Class property, but the Windows File Association set up for BMP
files was Microsoft Office Picture Manager. Originally it had been Paint.
I changed the association back to Paint and it now works correctly, as it
did a few months ago. There is probably a Class value for Picture Manager,
but at present I don't know what it is.

--
Cheers,
Lyn.

"Lyn" <lh******@ihug.com.au> wrote in message
news:d4**********@lust.ihug.co.nz...
OK, I have resolved the initial problem. Unfortunately the information I
gave would not have helped. The problem was that the Bound Object Frame
was not visible at the time of attempting to embed. Making the control
visible allowed the embedding to proceed. Stupid me!

However this has just raised a new problem, so I still need some help...

The size of the Frame on the form is set to Width 5 cm (2") and Height 6
cm (~2.2"). The embedded picture appears as a chunky square thumbnail
with the filename in large font underneath. The size of the thumbnail and
font seems to adjust automatically to fit the filename in the width of the
Frame. That is, a short filename = large thumbnail and font; long
filename = tiny thumbnail and smaller font. Naturally, I just want the
picture content (without the filename) to fill the Frame completely.

Some control property settings:
Size Mode: Zoom
Display Type: Content
Update Options: Manual
OLETypeAllowed: Embedded
Class: Paint.Picture
AutoActivate: Manual
Verb: 0

This problem is also occurring using the Insert->Object... menu item and
selecting Create from File. However, when I first started working on this
project I was able to use Insert->Object to insert just the full size
picture. I still have a number of early records with the full size
picture. That was a few months ago. Obviously something has happened
since then to change things. There must be an option or property that has
changed, but I can't find it.

Please, can anyone shed some light???

One other thing... When embedding, I get the hourglass icon for a good 20
seconds before the picture appears. I don't remember such a long delay
when I was first working in this area. Is this delay normal (my test
database is very small)???

--
TIA,
Lyn.

"Lyn" <lh******@ihug.com.au> wrote in message
news:d4**********@lust.ihug.co.nz...
I am trying to embed a picture into a Bound Object Frame (Me!Photograph)
with the following code which is based on MS article
http://support.microsoft.com/?id=158941:

strPathname = "C:\photo.bmp"
Me!Photograph.Class = "Paint.Picture"
Me!Photograph.OLETypeAllowed = acOLEEmbedded
Me!Photograph.SourceDoc = strPathname
Me!Photograph.Action = acOLECreateEmbed

I get the following helpful error message (Error 2793) when the .Action
statement is executed:

"Microsoft Office Access can't perform the operation specified in the
Action property of the Visual Basic procedure you're trying to run."

I am using Access 2003 under WinXP.

I am not sure if I have the right value for .Class for a .bmp object, or
if I should be using .OLEClass instead (or as well). I don't need to
edit the picture from this form or table -- just to store it and display
it.

Can anyone see what I am doing wrong? Or point me to a better tutorial
for this?

TIA for any help.

--
Cheers,
Lyn.


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Hugh Macdonald | last post: by
2 posts views Thread by Lyn | last post: by
3 posts views Thread by Tim T | last post: by
18 posts views Thread by J-T | last post: by
17 posts views Thread by anthony | last post: by
1 post views Thread by ambercolorenergy | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.