How can I display OLE object in a subform from main form

J

Jerry C

I am having trouble inserting an OLE Object into a bound
object frame. I have a HelpSubTopics combo box dropdown
where column 3 is a bitmap image.
I want to place this image in the bound object frame of
my subform.
This code does not work.
Forms![HelpTopicsFrm]![HelpTopicsSubFrm]![Image] =
Forms![HelpTopicsFrm]![HelpSubTopics].Column(3)

Thanks in advance for any ideas.
Jerry C.
KeepTraK Corporation
 
J

John Nurick

Hi Jerry,

To refer to a property of a control on a subform, you have to go via the
Form property of the subform control on the parent form, e.g.
Me.NameOfSubformControl.Form.NameOfControlOnSubform.PropertyOfControl
or
Forms("NameOfForm").Controls("NameOfSubformControl"). _
Form.Controls("NameOfControlOnSubform").PropertyOfControl

I guess that what have in your combobox is names or paths of bitmap
files rather than actual bitmap images. Are you trying to import these
into your database as the user selects them, or just display them on
your subform? If the former, I suggest you think again; Access stores
bitmaps very inefficiently and if there is a significant number of them
the size of the mdb file will bloat beyond reason.

To display just bitmaps, it's usually simpler to use an Image control
than an ObjectFrame. Take a look at the Employees form in the Northwind
sample database for an example.

I am having trouble inserting an OLE Object into a bound
object frame. I have a HelpSubTopics combo box dropdown
where column 3 is a bitmap image.
I want to place this image in the bound object frame of
my subform.
This code does not work.
Forms![HelpTopicsFrm]![HelpTopicsSubFrm]![Image] =
Forms![HelpTopicsFrm]![HelpSubTopics].Column(3)

Thanks in advance for any ideas.
Jerry C.
KeepTraK Corporation
 
J

Jerry C

Hi John Nurick,
I tried your idea without any success. Maybe I need to
describe further.

I have a table called "HelpSubTopicsTbl" The last field
of this table ("HelpSubjectImage") is a OLE Object data
type. The first record in table has a large
enbedded "Bitmap Image" in the "HelpSubjectImage" field.

I have a Form with a combo box dropdown that uses
the "HelpSubTopicsTbl" and column 3 is
the "HelpSubTopicsImage" I want to copy this image to a
Subform call "HelpTopicsSubFrm"

The big problem is the image is large and therefore I
need scroll bars in the subform.

Maybe I need to rethink this whole thing. I was just
hoping it could be done this way.

Jerry C.
-----Original Message-----
Hi Jerry,

To refer to a property of a control on a subform, you have to go via the
Form property of the subform control on the parent form, e.g.Me.NameOfSubformControl.Form.NameOfControlOnSubform.Proper
tyOfControl
or
Forms("NameOfForm").Controls("NameOfSubformControl"). _
Form.Controls ("NameOfControlOnSubform").PropertyOfControl

I guess that what have in your combobox is names or paths of bitmap
files rather than actual bitmap images. Are you trying to import these
into your database as the user selects them, or just display them on
your subform? If the former, I suggest you think again; Access stores
bitmaps very inefficiently and if there is a significant number of them
the size of the mdb file will bloat beyond reason.

To display just bitmaps, it's usually simpler to use an Image control
than an ObjectFrame. Take a look at the Employees form in the Northwind
sample database for an example.

I am having trouble inserting an OLE Object into a bound
object frame. I have a HelpSubTopics combo box dropdown
where column 3 is a bitmap image.
I want to place this image in the bound object frame of
my subform.
This code does not work.
Forms![HelpTopicsFrm]![HelpTopicsSubFrm]![Image] =
Forms![HelpTopicsFrm]![HelpSubTopics].Column(3)

Thanks in advance for any ideas.
Jerry C.
KeepTraK Corporation

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
J

John Nurick

Hi Jerry,

I still can't understand why you're using a subform. Also, I'm certain
that trying to include an OLE field in a combobox is a bad idea even if
it's possible. And there's no point using a BoundObjectFrame control
when you're not binding it to a field in the form's RecordSource: you'd
use an unbound ObjectFrame instead.

Setting aside for the moment the "bloat" argument against storing
significant numbers of large bitmap images in an Access OLE field, the
obvious approach appears to be:

1) Bind the main form to the table, or a query on the table. Use the
combobox to allow the user to select a record to be displayed,

2) Use a BoundObjectFrame (bound to the OLE field) to display the image.

But you don't get scrollbars in a BoundObjectFrame. If you want to
display more of the image than is visible in the control you just need
to double-click to open it in its parent application.

You may be able to find a third-party image control that gives you
scrollbars; I suggest taking a look at http://www.lebans.com


Hi John Nurick,
I tried your idea without any success. Maybe I need to
describe further.

I have a table called "HelpSubTopicsTbl" The last field
of this table ("HelpSubjectImage") is a OLE Object data
type. The first record in table has a large
enbedded "Bitmap Image" in the "HelpSubjectImage" field.

I have a Form with a combo box dropdown that uses
the "HelpSubTopicsTbl" and column 3 is
the "HelpSubTopicsImage" I want to copy this image to a
Subform call "HelpTopicsSubFrm"

The big problem is the image is large and therefore I
need scroll bars in the subform.

Maybe I need to rethink this whole thing. I was just
hoping it could be done this way.

Jerry C.
-----Original Message-----
Hi Jerry,

To refer to a property of a control on a subform, you have to go via the
Form property of the subform control on the parent form, e.g.Me.NameOfSubformControl.Form.NameOfControlOnSubform.Proper
tyOfControl
or
Forms("NameOfForm").Controls("NameOfSubformControl"). _
Form.Controls ("NameOfControlOnSubform").PropertyOfControl

I guess that what have in your combobox is names or paths of bitmap
files rather than actual bitmap images. Are you trying to import these
into your database as the user selects them, or just display them on
your subform? If the former, I suggest you think again; Access stores
bitmaps very inefficiently and if there is a significant number of them
the size of the mdb file will bloat beyond reason.

To display just bitmaps, it's usually simpler to use an Image control
than an ObjectFrame. Take a look at the Employees form in the Northwind
sample database for an example.

I am having trouble inserting an OLE Object into a bound
object frame. I have a HelpSubTopics combo box dropdown
where column 3 is a bitmap image.
I want to place this image in the bound object frame of
my subform.
This code does not work.
Forms![HelpTopicsFrm]![HelpTopicsSubFrm]![Image] =
Forms![HelpTopicsFrm]![HelpSubTopics].Column(3)

Thanks in advance for any ideas.
Jerry C.
KeepTraK Corporation

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top