Binding Picture to Control

  • Thread starter Thread starter Michael Banks
  • Start date Start date
M

Michael Banks

Hello and thanks,

I have a subform with several pictures associated with a control on the
form. The control in the subform is a text box with the folder location
of the picture that needs to be displayed. My problem is that the image
used in Access only looks at the first text box and doesn't bind to each
text box separately on the subform. The subform is a continuous form.

To better describe the problem I have attached a small screen shot of
what is going on. The Text box is changing for each record in the
recordset but the picture doesn't look for the appropriate text box.
What other images/picture viewing controls are available that would help
me out.

Thanks for your help
Mike
 
Michael,

You should not attach files to posts in technical discussion newsgroups;
because of the problem of malicious code, few people will open them.

I don't know what you mean by "the image used in Access only looks at the
first text box and ...." because an Image Control doesn't either look at
nor bind to any text box. I suppose you must have an unbound Image control
and be setting it from code (that's a detail that would have been worth
mentioning) and are running into the problem that there is only one detail
section defined for a continuous forms view form, and setting a property or
value for that unbound control applies to every displayed copy of it,
whether it is an Image Control, a Text Box, or other.

If you want to _bind_ a picture to a Control in a Continuous Form, you're
either going to have to use Bound OLE Frames, or find something that gets
'way down into the intenals. The only place I can suggest to look for the
"way down into the internals" kind of thing would be MVP Stephen Lebans'
site, http://www.lebans.com.

Larry Linson
Microsoft Access MVP



Michael Banks said:
Forgot to show the picture....

Michael said:
Hello and thanks,

I have a subform with several pictures associated with a control on the
form. The control in the subform is a text box with the folder location
of the picture that needs to be displayed. My problem is that the image
used in Access only looks at the first text box and doesn't bind to each
text box separately on the subform. The subform is a continuous form.

To better describe the problem I have attached a small screen shot of
what is going on. The Text box is changing for each record in the
recordset but the picture doesn't look for the appropriate text box.
What other images/picture viewing controls are available that would help
me out.
[Image]
Thanks for your help
Mike


----------------------------------------------------------------------------
----


Forgot to show the picture....
Michael Banks wrote:

Hello and thanks,
I have a subform with several pictures associated with a control on the
form. The control in the subform is a text box with the folder location
of the picture that needs to be displayed. My problem is that the image
used in Access only looks at the first text box and doesn't bind to each
text box separately on the subform. The subform is a continuous form.

To better describe the problem I have attached a small screen shot of
what is going on. The Text box is changing for each record in the
recordset but the picture doesn't look for the appropriate text box.
What other images/picture viewing controls are available that would help
me out.


Thanks for your help
Mike
 
Larry,

Thank-you for your help in this problem taht doesn't seem to be going away for
me.

So now I have a bound object frame that is attached correctly the each specific
text box. Now what property do you have to set so that you can display the
picture associated with that Bound Object Frame? When I was working with the
Image frame it was just:
Me!img0.picture = Me![loc0]
but obivously don't have that option anymore.

I am not sure what property I need to set to display the picture, that is why
some of the lines are commented out, I am just trying different options.

When the msgbox pops out I get the value of the Me![loc0]...the file location:
S:\...\...\...\abc.jpg
Thanks for your help with this.

The code that I have going now is:

If Not IsNull(Me![loc0]) Then
Me![img0].OLETypeAllowed = 0
' Me![img0].ControlSource = Me![loc0]
' Me![img0].SourceDoc = Me![loc0]
Me![img0].SourceItem = Me![loc0]
Me![img0].Verb = acOLEVerbShow
MsgBox Me!img0
End If
 
The only way I have ever used Bound OLE Frames was with pictures stored as
OLE Objects in the database. That is demonstrated in the sample databases at
http://accdevel.tripod.com. I've just never had the need to display a
picture on a continuous form, and have (except for the samples and learning)
not had occasion to do much else with OLE Objects and/or Bound OLE Frames.
In that case, the Bound OLE Frame would simply display the OLE Object field.

Larry Linson
Microsoft Access MVP
 
Back
Top