Updating Picture on main form from subform - 2nd try

  • Thread starter Thread starter John Rischmiller
  • Start date Start date
J

John Rischmiller

Second attempt to resolve this problem.

I have two tables, a master table and a detail table with multiple detail
records for each master. They are connected via a one-to-many relationship.

The detail record includes an ole field that is used to contain pictures.

I've a query to select all records.

I've used the form wizard to start off the data entry form and specified a
master form with a subform. The subform is tabular. The subform generated
included the picture in a bound object frame and works. However I want
multiple detail records displayed in the subform without the picture, with
the ability to click on or select a detail record and have the picture for
that record display in a control on the main form.

Jason suggested using a picturebox but the Toolbox doesn't have a picturebox
unlike VB, it has image, unbound object frame and bound object frame. I've
tried the bound object frame specified as per the detail record but it shows
nothing.

I hope I've made it clearer this time.

Regards - John
 
Here's something you could try:
Put a small bound object frame (DetailPicture) in the Detail section of your
subform.
set its controlsource to your OLE field, and its visible property to
False.
Put an unbound object frame (MainPicture) on the main form.
Set its Locked property to False and its Enabled to True.
In your subform's OnCurrent event, put code like this: (WARNING: AIR CODE)
Me.Parent!MainPicture.PictureData=Me!DetailPicture.PictureData

Be advised, though, that storing OLE images directly in your database like
this will bloat your database significantly.

HTH
- Turtle
 
Back
Top