Updating Picture on Main Form from Sub Form

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

John Rischmiller

Access 2002. Have a typical Main-subform based on two tables with a one to
many relationship. The subform is tabular. The many side table has an ole
field containing a picture. I want a single picture on the main form showing
the picture of the subform detail record currently selected. Which control
is best for this purpose and how would I code it? I assume the code should
go in the Form_Click event of the subform, but the ole unbound frame control
complains about not being initialised, and I can't find the code to set the
image control to table field.

Best regards - John
 
You don't have to add code for this. Add a picture box control to the form, bind it to the field that corresponds to the image needed. Your message was a little confusing. In either case, if your many side table has a different image (possibly) for each record, then that will be your datasource.
 
Thanks, Jason, sorry if the question was unclear, I'll try and be more
explicit.

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.

You suggest 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.

Regards - John

Jason said:
You don't have to add code for this. Add a picture box control to the
form, bind it to the field that corresponds to the image needed. Your
message was a little confusing. In either case, if your many side table has
a different image (possibly) for each record, then that will be your
datasource.
 
Back
Top