@GinaWhipp, is that question for me? Yes, always. Never used OLEObject controls.
@GinaWhipp, is that question for me? Yes, always. Never used OLEObject controls.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
ah yes, not directly, but you can indirectly which is what I was thinking about (my bad for not checking)
have a textbox called say itext1 - this can be hidden
in image control have controlsource =[itext1]
in code have
itext1.ControlSource = "=""" & strpath & rs!PartNo & ".jpg"""
what I don't understand is if this works
Me!Image1.Picture = strpath & rs!PartNo & ".jpg"
rs.movenext
Me!Image2.Picture = strpath & rs!PartNo & ".jpg"
rs.movenext
why did the OP try
Me.Picture("Image" & i) = strpath & Rs!PartNo & ".jpg"
why not just use in the loop
Me.Controls("Image" & I).Picture = strpath & rs!PartNo & ".jpg"
or
Me("Image" & I).Picture = strpath & rs!PartNo & ".jpg"
Also not clear about the loop - first there have to be at lease 64 partnos >999999 - fair enough it works for the text, so I guess there are. But what if there is no image associated with that part? an error would be generated - unless error reporting has been turned off.
@June
No, it was for the OP just to be sure because the
Should have worked and I wondered if the OP was using correct control.Code:Me.Controls("Image" & i).Picture
Ajax, oops, I stand corrected. Can set textbox ControlSource on report with Open event but that will not allow dynamic loading of data. And cannot set ControlSource in Format event.
Yes Gina, that is supposed to work with image control, I've just never had to use VBA to dynamically load images.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok, thanks for all the assistance.
Me.Controls("Image" & i).picture = strpath & rs!PartNo & ".jpg"
is the solution. Knew it was there somewhere and thanks to the various suggestions we get to the answer.
Not sure how I close off the thread and mark it as solved but solved it is.
Many thanks to all of you for your input.
at the top of the thread, 'click on thread tools', then select 'mark this thread as solved'Not sure how I close off the thread
Glad you have a solution. I am still inclined to think possible without VBA.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.